Commit b90e795f authored by Michael Niedermayer's avatar Michael Niedermayer

check std tag size before reading.

Fixes out of array read

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent a7ee6281
...@@ -134,6 +134,10 @@ static int fourxm_read_header(AVFormatContext *s) ...@@ -134,6 +134,10 @@ static int fourxm_read_header(AVFormatContext *s)
} }
if (fourcc_tag == std__TAG) { 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])); fourxm->fps = av_int2float(AV_RL32(&header[i + 12]));
} else if (fourcc_tag == vtrk_TAG) { } else if (fourcc_tag == vtrk_TAG) {
/* check that there is enough data */ /* check that there is enough data */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment