From 505aa6c91d91b6592f04bc77ab82bb718be26ec5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Axelsson?= Date: Mon, 9 Feb 2009 01:58:01 +0000 Subject: Check that there are subtitle rects to encode in avcodec_encode_subtitle() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Patch by Björn Axelsson ( gecko A acc D umu D se ) Originally committed as revision 17093 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/utils.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libavcodec') diff --git a/libavcodec/utils.c b/libavcodec/utils.c index a1383a3..215029d 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -505,6 +505,8 @@ int avcodec_encode_subtitle(AVCodecContext *avctx, uint8_t *buf, int buf_size, 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; -- cgit v1.1