mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +02:00
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>
This commit is contained in:
parent
9bab7de175
commit
8ffd3ef9d9
@ -226,7 +226,7 @@ static int rv20_decode_picture_header(RVDecContext *rv)
|
|||||||
new_w = rv->orig_width;
|
new_w = rv->orig_width;
|
||||||
new_h = rv->orig_height;
|
new_h = rv->orig_height;
|
||||||
}
|
}
|
||||||
if (new_w != s->width || new_h != s->height) {
|
if (new_w != s->width || new_h != s->height || !s->context_initialized) {
|
||||||
AVRational old_aspect = s->avctx->sample_aspect_ratio;
|
AVRational old_aspect = s->avctx->sample_aspect_ratio;
|
||||||
av_log(s->avctx, AV_LOG_DEBUG,
|
av_log(s->avctx, AV_LOG_DEBUG,
|
||||||
"attempting to change resolution to %dx%d\n", new_w, new_h);
|
"attempting to change resolution to %dx%d\n", new_w, new_h);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user