aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/mpegvideo.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-11-24 17:05:04 +0000
committerVittorio Giovara <vittorio.giovara@gmail.com>2014-12-03 12:52:53 +0000
commit894545cb717427a47f800dc7738b923afde139a6 (patch)
tree11380d386e8fe2b9e85b099324c40c2db0ecf532 /libavcodec/mpegvideo.c
parent7a38987f245e3c280d81442f207b983333b6233c (diff)
downloadffmpeg-894545cb717427a47f800dc7738b923afde139a6.tar.gz
mpegvideo: exit cleanly when ff_mpv_common_frame_size_change() fails
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Diffstat (limited to 'libavcodec/mpegvideo.c')
-rw-r--r--libavcodec/mpegvideo.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 868f715513..e6a48cd935 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -1436,8 +1436,8 @@ int ff_mpv_common_frame_size_change(MpegEncContext *s)
s->mb_height = (s->height + 15) / 16;
if ((s->width || s->height) &&
- av_image_check_size(s->width, s->height, 0, s->avctx))
- return AVERROR_INVALIDDATA;
+ (err = av_image_check_size(s->width, s->height, 0, s->avctx)) < 0)
+ goto fail;
if ((err = init_context_frame(s)))
goto fail;
@@ -1453,7 +1453,7 @@ int ff_mpv_common_frame_size_change(MpegEncContext *s)
}
for (i = 0; i < nb_slices; i++) {
- if (init_duplicate_context(s->thread_context[i]) < 0)
+ if ((err = init_duplicate_context(s->thread_context[i])) < 0)
goto fail;
s->thread_context[i]->start_mb_y =
(s->mb_height * (i) + nb_slices / 2) / nb_slices;