avcodec/vp9: Fixed memory leak when vp9_frame_alloc() function fails.

This commit is contained in:
Aleksoid
2026-03-25 14:57:37 +10:00
committed by Kacper Michajłow
parent e17d84ac8a
commit e84b3c7e98

View File

@@ -1637,8 +1637,10 @@ static int vp9_decode_frame(AVCodecContext *avctx, AVFrame *frame,
vp9_frame_replace(&s->s.frames[REF_FRAME_SEGMAP], src);
vp9_frame_replace(&s->s.frames[REF_FRAME_MVPAIR], src);
vp9_frame_unref(&s->s.frames[CUR_FRAME]);
if ((ret = vp9_frame_alloc(avctx, &s->s.frames[CUR_FRAME])) < 0)
if ((ret = vp9_frame_alloc(avctx, &s->s.frames[CUR_FRAME])) < 0) {
ff_cbs_fragment_reset(&s->current_frag);
return ret;
}
s->s.frames[CUR_FRAME].header_ref = av_refstruct_ref(s->header_ref);
s->s.frames[CUR_FRAME].frame_header = s->frame_header;