diff mbox series

[FFmpeg-devel,01/18] avradio/sdrdemux: Fix uninitialized access

Message ID 20230708212530.109692-1-michael@niedermayer.cc
State New
Headers show
Series [FFmpeg-devel,01/18] avradio/sdrdemux: Fix uninitialized access | expand

Checks

Context Check Description
yinshiyou/configure_loongarch64 warning Failed to apply patch
andriy/configure_x86 warning Failed to apply patch

Commit Message

Michael Niedermayer July 8, 2023, 9:25 p.m. UTC
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavradio/sdrdemux.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Michael Niedermayer July 9, 2023, 11:43 p.m. UTC | #1
On Sat, Jul 08, 2023 at 11:25:13PM +0200, Michael Niedermayer wrote:
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavradio/sdrdemux.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

will apply patchset

[...]
diff mbox series

Patch

diff --git a/libavradio/sdrdemux.c b/libavradio/sdrdemux.c
index bed74ebd26..3bb5a69cf1 100644
--- a/libavradio/sdrdemux.c
+++ b/libavradio/sdrdemux.c
@@ -1500,9 +1500,11 @@  int avpriv_sdr_common_init(AVFormatContext *s)
         SDRStream *sst = st->priv_data;
         av_assert0(st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO);
         sst->frame_size   = sdr->width * sdr->height * 4;
-        sst->frame_buffer = av_malloc(sst->frame_size * 2);
+        sst->frame_buffer = av_mallocz(sst->frame_size * 2);
         if (!sst->frame_buffer)
             return AVERROR(ENOMEM);
+        for(int i = 3; i<sst->frame_size * 2; i+=4)
+            sst->frame_buffer[i] = 255;
     }
 
     sdr->pts = 0;