diff options
author | Björn Axelsson <gecko@acc.umu.se> | 2009-02-09 01:58:01 +0000 |
---|---|---|
committer | Robert Swain <robert.swain@gmail.com> | 2009-02-09 01:58:01 +0000 |
commit | 505aa6c91d91b6592f04bc77ab82bb718be26ec5 (patch) | |
tree | bf3abbbb5ecabccf5717144fbc509c1c62d38827 /libavcodec/utils.c | |
parent | 9413db9e04178393612f86561b70550b2c47545d (diff) | |
download | ffmpeg-505aa6c91d91b6592f04bc77ab82bb718be26ec5.tar.gz |
Check that there are subtitle rects to encode in avcodec_encode_subtitle()
Patch by Björn Axelsson ( gecko A acc D umu D se )
Originally committed as revision 17093 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r-- | libavcodec/utils.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c index a1383a3d17..215029d789 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; |