[FFmpeg-cvslog] avformat/img2dec: zero probe buffer

Michael Niedermayer git at videolan.org
Mon Mar 31 23:48:27 CEST 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Mon Mar 31 23:42:08 2014 +0200| [1f361124d97cf8b8ce6d3aacb10cdc53706470de] | committer: Michael Niedermayer

avformat/img2dec: zero probe buffer

Fixes use of uninitialized memory
Fixes valgrind failure

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1f361124d97cf8b8ce6d3aacb10cdc53706470de
---

 libavformat/img2dec.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c
index d491241..5da123f 100644
--- a/libavformat/img2dec.c
+++ b/libavformat/img2dec.c
@@ -361,6 +361,7 @@ int ff_img_read_packet(AVFormatContext *s1, AVPacket *pkt)
             ret = avio_read(f[0], header, PROBE_BUF_MIN);
             if (ret < 0)
                 return ret;
+            memset(header + ret, 0, sizeof(header) - ret);
             avio_skip(f[0], -ret);
             pd.buf = header;
             pd.buf_size = ret;



More information about the ffmpeg-cvslog mailing list