1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

lavc/diracdec: check av_frame_alloc() failure.

This commit is contained in:
Nicolas George 2013-12-29 10:49:01 +01:00
parent 38004051b5
commit a91394f4de

View File

@ -406,8 +406,14 @@ static av_cold int dirac_decode_init(AVCodecContext *avctx)
ff_dsputil_init(&s->dsp, avctx);
ff_diracdsp_init(&s->diracdsp);
for (i = 0; i < MAX_FRAMES; i++)
for (i = 0; i < MAX_FRAMES; i++) {
s->all_frames[i].avframe = av_frame_alloc();
if (!s->all_frames[i].avframe) {
while (i > 0)
av_frame_free(&s->all_frames[--i].avframe);
return AVERROR(ENOMEM);
}
}
return 0;
}