Merge commit 'a594f17f83a1ffdc1eec18818208fe39487dd5d7'

* commit 'a594f17f83a1ffdc1eec18818208fe39487dd5d7':
  dvbsubdec: Free subrect memory on allocation error
  dvbsubdec: Fixed segfault when decoding subtitles

See
fbb59a3bf4
39dfe6801a

Merged-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer 2017-11-06 18:46:05 -03:00
commit 7d1c79f533
1 changed files with 6 additions and 1 deletions

View File

@ -753,8 +753,13 @@ static int save_subtitle_set(AVCodecContext *avctx, AVSubtitle *sub, int *got_ou
goto fail;
}
for(i=0; i<sub->num_rects; i++)
for (i = 0; i < sub->num_rects; i++) {
sub->rects[i] = av_mallocz(sizeof(*sub->rects[i]));
if (!sub->rects[i]) {
ret = AVERROR(ENOMEM);
goto fail;
}
}
i = 0;