xsubenc: only 1 rectangle is supported so dont allow 0 as it would crash.
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 4 May 2011 17:01:42 +0000 (19:01 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 4 May 2011 21:33:59 +0000 (23:33 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/xsubenc.c

index c448a22..a7e3a89 100644 (file)
@@ -129,7 +129,7 @@ static int xsub_encode(AVCodecContext *avctx, unsigned char *buf,
     }
 
     // TODO: support multiple rects
-    if (h->num_rects > 1)
+    if (h->num_rects != 1)
         av_log(avctx, AV_LOG_WARNING, "Only single rects supported (%d in subtitle.)\n", h->num_rects);
 
     // TODO: render text-based subtitles into bitmaps