ffv1: change w/h asserts to check as the condition can likely happen
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 6 Oct 2012 01:12:25 +0000 (03:12 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 6 Oct 2012 01:16:24 +0000 (03:16 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/ffv1.c

index f946122..5ce8e7a 100644 (file)
@@ -700,6 +700,9 @@ static void write_header(FFV1Context *f){
 static av_cold int common_init(AVCodecContext *avctx){
     FFV1Context *s = avctx->priv_data;
 
+    if(!avctx->width || !avctx->height)
+        return AVERROR_INVALIDDATA;
+
     s->avctx= avctx;
     s->flags= avctx->flags;
 
@@ -710,7 +713,6 @@ static av_cold int common_init(AVCodecContext *avctx){
     s->width = avctx->width;
     s->height= avctx->height;
 
-    assert(s->width && s->height);
     //defaults
     s->num_h_slices=1;
     s->num_v_slices=1;