Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjörn Axelsson <gecko@acc.umu.se>2009-02-09 04:58:01 +0300
committerRobert Swain <robert.swain@gmail.com>2009-02-09 04:58:01 +0300
commit505aa6c91d91b6592f04bc77ab82bb718be26ec5 (patch)
treebf3abbbb5ecabccf5717144fbc509c1c62d38827 /libavcodec/utils.c
parent9413db9e04178393612f86561b70550b2c47545d (diff)
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.c2
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;