[FFmpeg-cvslog] avcodec/mjpegdec: use mallocz for progressive blocks
Michael Niedermayer
git at videolan.org
Fri Dec 13 20:35:00 CET 2013
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Dec 13 20:25:38 2013 +0100| [0c23ee131257403332d4d06113473241f14d1010] | committer: Michael Niedermayer
avcodec/mjpegdec: use mallocz for progressive blocks
Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7f849c599487_6828_mjpeg.avi
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0c23ee131257403332d4d06113473241f14d1010
---
libavcodec/mjpegdec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 187f325..e86e093 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -510,7 +510,7 @@ unk_pixfmt:
int size = bw * bh * s->h_count[i] * s->v_count[i];
av_freep(&s->blocks[i]);
av_freep(&s->last_nnz[i]);
- s->blocks[i] = av_malloc(size * sizeof(**s->blocks));
+ s->blocks[i] = av_mallocz(size * sizeof(**s->blocks));
s->last_nnz[i] = av_mallocz(size * sizeof(**s->last_nnz));
if (!s->blocks[i] || !s->last_nnz[i])
return AVERROR(ENOMEM);
More information about the ffmpeg-cvslog
mailing list