X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fffv1.c;h=a14dd2aab24594eee0ff7a33e5a3a40dbae798c1;hb=45f5c5573203a48acb2dd6fbf18f4b0c25b7aff0;hp=80a9434eb7eb74445d6cc09ecd24a491247341ff;hpb=4890b0851c5e6b607c9b8695166f13dc770b19bc;p=ffmpeg diff --git a/libavcodec/ffv1.c b/libavcodec/ffv1.c index 80a9434eb7e..a14dd2aab24 100644 --- a/libavcodec/ffv1.c +++ b/libavcodec/ffv1.c @@ -144,7 +144,11 @@ av_cold int ff_ffv1_init_slice_contexts(FFV1Context *f) fs->sample_buffer = av_malloc_array((fs->width + 6), 3 * MAX_PLANES * sizeof(*fs->sample_buffer)); - if (!fs->sample_buffer) { + fs->sample_buffer32 = av_malloc_array((fs->width + 6), 3 * MAX_PLANES * + sizeof(*fs->sample_buffer32)); + if (!fs->sample_buffer || !fs->sample_buffer32) { + av_freep(&fs->sample_buffer); + av_freep(&fs->sample_buffer32); av_freep(&f->slice_context[i]); goto memfail; } @@ -154,6 +158,7 @@ av_cold int ff_ffv1_init_slice_contexts(FFV1Context *f) memfail: while(--i >= 0) { av_freep(&f->slice_context[i]->sample_buffer); + av_freep(&f->slice_context[i]->sample_buffer32); av_freep(&f->slice_context[i]); } return AVERROR(ENOMEM); @@ -224,6 +229,7 @@ av_cold int ff_ffv1_close(AVCodecContext *avctx) av_freep(&p->vlc_state); } av_freep(&fs->sample_buffer); + av_freep(&fs->sample_buffer32); } av_freep(&avctx->stats_out);