Commit 211dcdca authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '522d971c'

* commit '522d971c':
  xsub: Check memory allocation

Conflicts:
	libavcodec/xsubdec.c
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 1dc58965 522d971c
......@@ -109,10 +109,11 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
sub->rects[0]->nb_colors = 4;
sub->rects[0]->pict.data[1] = av_mallocz(AVPALETTE_SIZE);
if (!sub->rects[0]->pict.data[0] || !sub->rects[0]->pict.data[1]) {
av_freep(&sub->rects[0]->pict.data[1]);
av_freep(&sub->rects[0]->pict.data[0]);
av_freep(&sub->rects[0]);
av_freep(&sub->rects);
return AVERROR(ENOMEM);
}
sub->num_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