diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-04-15 17:17:21 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-04-26 21:15:33 +0200 |
commit | 2a623bacc8457c51477f02f06ff9eff16afb615a (patch) | |
tree | ddf4e12476e63799ed717692d1f00109c846140b /libavcodec/svq3.c | |
parent | ef02cf829082686442c4c9d594651a5d34f703ef (diff) |
avcodec/svq3: Free array of frames in a loop
Avoids code duplication
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/svq3.c')
-rw-r--r-- | libavcodec/svq3.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c index 0d108da06f..396555b337 100644 --- a/libavcodec/svq3.c +++ b/libavcodec/svq3.c @@ -1587,12 +1587,10 @@ static av_cold int svq3_decode_end(AVCodecContext *avctx) { SVQ3Context *s = avctx->priv_data; - free_picture(s->cur_pic); - free_picture(s->next_pic); - free_picture(s->last_pic); - av_frame_free(&s->cur_pic->f); - av_frame_free(&s->next_pic->f); - av_frame_free(&s->last_pic->f); + for (int i = 0; i < FF_ARRAY_ELEMS(s->frames); i++) { + free_picture(&s->frames[i]); + av_frame_free(&s->frames[i].f); + } av_freep(&s->slice_buf); av_freep(&s->intra4x4_pred_mode); av_freep(&s->edge_emu_buffer); |