Skip to content

Commit 4562719

Browse files
committed
avcodec/rv10: Don't presume context to be initialized
In case of resolution changes rv20_decode_picture_header() closes and reopens its MpegEncContext; it checks the latter for errors, yet when an error happens, it might happen that no new attempt at reinitialization is performed when decoding the next frame; this leads to crashes lateron. This commit fixes this by making sure that initialization will always be attempted if the context is currently not initialized. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> (cherry picked from commit 8ffd3ef)
1 parent 6d7dfab commit 4562719

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libavcodec/rv10.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ static int rv20_decode_picture_header(RVDecContext *rv)
226226
new_w = rv->orig_width;
227227
new_h = rv->orig_height;
228228
}
229-
if (new_w != s->width || new_h != s->height) {
229+
if (new_w != s->width || new_h != s->height || !s->context_initialized) {
230230
AVRational old_aspect = s->avctx->sample_aspect_ratio;
231231
av_log(s->avctx, AV_LOG_DEBUG,
232232
"attempting to change resolution to %dx%d\n", new_w, new_h);

0 commit comments

Comments
 (0)