Message ID | 20230708212530.109692-1-michael@niedermayer.cc |
---|---|
State | New |
Headers | show |
Series | [FFmpeg-devel,01/18] avradio/sdrdemux: Fix uninitialized access | expand |
Context | Check | Description |
---|---|---|
yinshiyou/configure_loongarch64 | warning | Failed to apply patch |
andriy/configure_x86 | warning | Failed to apply patch |
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 --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;
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> --- libavradio/sdrdemux.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)