From: Michael Niedermayer Date: Tue, 9 Jul 2013 19:10:45 +0000 (+0200) Subject: snowenc: check minimum resolution X-Git-Tag: android-x86-4.4-r1~2451 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=325411a687c4b9a439a42bf607d5fbfc41c44836;p=android-x86%2Fexternal-ffmpeg.git snowenc: check minimum resolution Fixes Ticket1855 Signed-off-by: Michael Niedermayer --- diff --git a/libavcodec/snowenc.c b/libavcodec/snowenc.c index 7266ee12f0..586dc1d830 100644 --- a/libavcodec/snowenc.c +++ b/libavcodec/snowenc.c @@ -1770,6 +1770,11 @@ redo_frame: || !(height>>(s->chroma_v_shift + s->spatial_decomposition_count))) s->spatial_decomposition_count--; + if (s->spatial_decomposition_count <= 0) { + av_log(avctx, AV_LOG_ERROR, "Resolution too low\n"); + return AVERROR(EINVAL); + } + s->m.pict_type = pic->pict_type; s->qbias = pic->pict_type == AV_PICTURE_TYPE_P ? 2 : 0;