summaryrefslogtreecommitdiff
path: root/libavformat/mvdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-01-27 02:14:38 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-01-27 02:15:02 +0100
commit5de286ef88befc23959d345c12d27a76095b8b0e (patch)
tree3f61d9a4a79fa978a6317eaaf01888429ce3b890 /libavformat/mvdec.c
parent362271d72fc38cd1f4b076aff9a12b1104c26760 (diff)
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@gmx.at>
Diffstat (limited to 'libavformat/mvdec.c')
-rw-r--r--libavformat/mvdec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/mvdec.c b/libavformat/mvdec.c
index 03471f1556..103a40af6d 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")) {