Commit a443b48c authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/rmdec: Check for overflow in ff_rm_read_mdpr_codecdata()

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 03abf55f)
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent a45402d4
...@@ -412,7 +412,11 @@ ff_rm_read_mdpr_codecdata (AVFormatContext *s, AVIOContext *pb, ...@@ -412,7 +412,11 @@ ff_rm_read_mdpr_codecdata (AVFormatContext *s, AVIOContext *pb,
skip: skip:
/* skip codec info */ /* skip codec info */
size = avio_tell(pb) - codec_pos; size = avio_tell(pb) - codec_pos;
avio_skip(pb, codec_data_size - size); if (codec_data_size >= size) {
avio_skip(pb, codec_data_size - size);
} else {
av_log(s, AV_LOG_WARNING, "codec_data_size %u < size %d\n", codec_data_size, size);
}
return 0; return 0;
} }
......
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