Commit de608805 authored by Nicolas George's avatar Nicolas George

lavc/dvdsubenc: check the type of rectangles.

Avoid a crash if a text rectangle is provided.
Fix the segfault reported in trac ticket #1661.
parent 12b1512e
......@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment