lavc/dvdsubenc: check the type of rectangles.
Avoid a crash if a text rectangle is provided. Fix the segfault reported in trac ticket #1661.
This commit is contained in:
parent
12b1512e85
commit
de60880543
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user