[FFmpeg-cvslog] snowenc: check minimum resolution

Michael Niedermayer git at videolan.org
Tue Jul 9 21:17:37 CEST 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Jul  9 21:10:45 2013 +0200| [325411a687c4b9a439a42bf607d5fbfc41c44836] | committer: Michael Niedermayer

snowenc: check minimum resolution

Fixes Ticket1855

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=325411a687c4b9a439a42bf607d5fbfc41c44836
---

 libavcodec/snowenc.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/snowenc.c b/libavcodec/snowenc.c
index 7266ee1..586dc1d 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;
 



More information about the ffmpeg-cvslog mailing list