[FFmpeg-cvslog] ffv1: change w/h asserts to check as the condition can likely happen

Michael Niedermayer git at videolan.org
Sat Oct 6 03:21:23 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Oct  6 03:12:25 2012 +0200| [856834a77f4145adc5951e8b08984981fed4463d] | committer: Michael Niedermayer

ffv1: change w/h asserts to check as the condition can likely happen

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

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

 libavcodec/ffv1.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavcodec/ffv1.c b/libavcodec/ffv1.c
index f946122..5ce8e7a 100644
--- a/libavcodec/ffv1.c
+++ b/libavcodec/ffv1.c
@@ -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;



More information about the ffmpeg-cvslog mailing list