diff utils.c @ 8772:5a9485bd4421 libavcodec

Check that there are subtitle rects to encode in avcodec_encode_subtitle() Patch by Bj«Órn Axelsson ( gecko A acc D umu D se )
author superdump
date Mon, 09 Feb 2009 01:58:01 +0000
parents f7442819cacf
children 90c99bda19f5
line wrap: on
line diff
--- a/utils.c	Mon Feb 09 01:51:36 2009 +0000
+++ b/utils.c	Mon Feb 09 01:58:01 2009 +0000
@@ -505,6 +505,8 @@
         av_log(avctx, AV_LOG_ERROR, "start_display_time must be 0.\n");
         return -1;
     }
+    if(sub->num_rects == 0 || !sub->rects)
+        return -1;
     ret = avctx->codec->encode(avctx, buf, buf_size, sub);
     avctx->frame_number++;
     return ret;