[FFmpeg-cvslog] mvdec: check var_read_string() return value

Michael Niedermayer git at videolan.org
Sun Jan 27 02:51:50 CET 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Jan 27 02:14:38 2013 +0100| [5de286ef88befc23959d345c12d27a76095b8b0e] | committer: Michael Niedermayer

mvdec: check var_read_string() return value

Prevent null pointer dereference

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=5de286ef88befc23959d345c12d27a76095b8b0e
---

 libavformat/mvdec.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/mvdec.c b/libavformat/mvdec.c
index 03471f1..103a40a 100644
--- a/libavformat/mvdec.c
+++ b/libavformat/mvdec.c
@@ -158,6 +158,8 @@ static int parse_video_var(AVFormatContext *avctx, AVStream *st, const char *nam
         st->nb_frames = st->duration = var_read_int(pb, size);
     } else if (!strcmp(name, "COMPRESSION")) {
         char * str = var_read_string(pb, size);
+        if (!str)
+            return AVERROR_INVALIDDATA;
         if (!strcmp(str, "1")) {
             st->codec->codec_id = AV_CODEC_ID_MVC1;
         } else if (!strcmp(str, "2")) {



More information about the ffmpeg-cvslog mailing list