OSDN Git Service

snowenc: check minimum resolution
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 9 Jul 2013 19:10:45 +0000 (21:10 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 9 Jul 2013 19:10:45 +0000 (21:10 +0200)
Fixes Ticket1855

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/snowenc.c

index 7266ee1..586dc1d 100644 (file)
@@ -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;