summaryrefslogtreecommitdiff
path: root/libavcodec/dvdsubenc.c
diff options
context:
space:
mode:
authorNicolas George <nicolas.george@normalesup.org>2012-08-19 19:10:48 +0200
committerNicolas George <nicolas.george@normalesup.org>2012-08-24 12:12:41 +0200
commitde60880543761003c3674d5d29e0af348f5eb301 (patch)
treea7dd6cbb91971caef1fb164bf11e3808b1c6aa03 /libavcodec/dvdsubenc.c
parent12b1512e855a423e2103968bfc0d763678a09ed8 (diff)
downloadffmpeg-de60880543761003c3674d5d29e0af348f5eb301.tar.gz
lavc/dvdsubenc: check the type of rectangles.
Avoid a crash if a text rectangle is provided. Fix the segfault reported in trac ticket #1661.
Diffstat (limited to 'libavcodec/dvdsubenc.c')
-rw-r--r--libavcodec/dvdsubenc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/dvdsubenc.c b/libavcodec/dvdsubenc.c
index c87f3369c4..d913708026 100644
--- a/libavcodec/dvdsubenc.c
+++ b/libavcodec/dvdsubenc.c
@@ -256,6 +256,11 @@ static int encode_dvd_subtitles(AVCodecContext *avctx,
if (rects == 0 || h->rects == NULL)
return AVERROR(EINVAL);
+ for (i = 0; i < rects; i++)
+ if (h->rects[i]->type != SUBTITLE_BITMAP) {
+ av_log(avctx, AV_LOG_ERROR, "Bitmap subtitle required\n");
+ return AVERROR(EINVAL);
+ }
vrect = *h->rects[0];
if (rects > 1) {