diff mbox series

[FFmpeg-devel,4/7] avcodec/wavpack: Only initialize DSD data when encountering DSD

Message ID GV1P250MB0737D3BBEB4E48EDE03240EA8F3E2@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM
State Accepted
Commit e81fa9f482122311186840798d50c566674da93f
Headers show
Series [FFmpeg-devel,1/7] avcodec/wavpack: Fix leak and segfault on reallocation error | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished

Commit Message

Andreas Rheinhardt April 2, 2024, 1:37 a.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/wavpack.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c
index 36bd4662e8..c96c8e0583 100644
--- a/libavcodec/wavpack.c
+++ b/libavcodec/wavpack.c
@@ -1049,8 +1049,6 @@  static av_cold int wavpack_decode_init(AVCodecContext *avctx)
     if (!s->curr_frame.f || !s->prev_frame.f)
         return AVERROR(ENOMEM);
 
-    ff_init_dsd_data();
-
     return 0;
 }
 
@@ -1529,6 +1527,7 @@  static int wavpack_decode_block(AVCodecContext *avctx, int block_no,
                 return ret;
             }
             ff_thread_release_ext_buffer(&wc->curr_frame);
+            ff_init_dsd_data();
         }
         av_channel_layout_copy(&avctx->ch_layout, &new_ch_layout);
         avctx->sample_rate         = new_samplerate;