aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-12-06 00:18:29 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-12-06 00:49:23 +0100
commit03abf55f252945c70f4a79eaf4d609cee4d98710 (patch)
tree1309e2d69dc10704be983e88e884cf6bc4bda79c
parent50f9de59a08f4bbacda298377339318e3eb87b8e (diff)
downloadffmpeg-03abf55f252945c70f4a79eaf4d609cee4d98710.tar.gz
avformat/rmdec: Check for overflow in ff_rm_read_mdpr_codecdata()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/rmdec.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c
index e267b01a1a..299c74237c 100644
--- a/libavformat/rmdec.c
+++ b/libavformat/rmdec.c
@@ -414,7 +414,11 @@ int ff_rm_read_mdpr_codecdata(AVFormatContext *s, AVIOContext *pb,
skip:
/* skip codec info */
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;
}