diff mbox series

[FFmpeg-devel] tools/target_dec_fuzzer: Check that FFv1 doesnt leave uninitialized memory in its buffers

Message ID 20240812132951.1409672-1-michael@niedermayer.cc
State New
Headers show
Series [FFmpeg-devel] tools/target_dec_fuzzer: Check that FFv1 doesnt leave uninitialized memory in its buffers | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished

Commit Message

Michael Niedermayer Aug. 12, 2024, 1:29 p.m. UTC
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 tools/target_dec_fuzzer.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

Comments

Michael Niedermayer Aug. 14, 2024, 2:32 p.m. UTC | #1
On Mon, Aug 12, 2024 at 03:29:51PM +0200, Michael Niedermayer wrote:
> Sponsored-by: Sovereign Tech Fund
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  tools/target_dec_fuzzer.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)

will apply

[...]
diff mbox series

Patch

diff --git a/tools/target_dec_fuzzer.c b/tools/target_dec_fuzzer.c
index 794b5b92cc7..5fccf2ab8fc 100644
--- a/tools/target_dec_fuzzer.c
+++ b/tools/target_dec_fuzzer.c
@@ -129,7 +129,14 @@  static int fuzz_video_get_buffer(AVCodecContext *ctx, AVFrame *frame)
 
     frame->extended_data = frame->data;
     for (i = 0; i < 4 && size[i]; i++) {
-        frame->buf[i] = av_buffer_allocz(size[i]);
+        switch(ctx->codec_id) {
+        case AV_CODEC_ID_FFV1:
+            frame->buf[i] = av_buffer_alloc(size[i]);
+        break;
+        default:
+            frame->buf[i] = av_buffer_allocz(size[i]);
+        }
+
         if (!frame->buf[i])
             goto fail;
         frame->data[i] = frame->buf[i]->data;