aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-12-01 00:29:39 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-12-01 00:30:11 +0100
commitb90e795f737c5efb9f65869b304e87a0985b046d (patch)
tree474f9aab2f0bd70c222d8fda8c8ba6887c4bf827
parenta7ee6281f7ef1c29284e3a4cadfe0f227ffde1ed (diff)
downloadffmpeg-b90e795f737c5efb9f65869b304e87a0985b046d.tar.gz
check std tag size before reading.
Fixes out of array read Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/4xm.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/4xm.c b/libavformat/4xm.c
index 0a003d4b8e..1e142f550f 100644
--- a/libavformat/4xm.c
+++ b/libavformat/4xm.c
@@ -134,6 +134,10 @@ static int fourxm_read_header(AVFormatContext *s)
}
if (fourcc_tag == std__TAG) {
+ if (header_size < i + 16) {
+ av_log(s, AV_LOG_ERROR, "std TAG truncated\n");
+ return AVERROR_INVALIDDATA;
+ }
fourxm->fps = av_int2float(AV_RL32(&header[i + 12]));
} else if (fourcc_tag == vtrk_TAG) {
/* check that there is enough data */