aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-12-06 00:18:29 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-01-18 00:27:55 +0100
commit3e8b73e65bb0f2bec1362b2a78bed7b11d31326e (patch)
tree2f1702d4f5ab320072e7d0ac142570eee9f8fc53
parent8babbdc9b15fd7eb702ab49cd2054d0138fa59bf (diff)
downloadffmpeg-3e8b73e65bb0f2bec1362b2a78bed7b11d31326e.tar.gz
avformat/rmdec: Check for overflow in ff_rm_read_mdpr_codecdata()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 03abf55f252945c70f4a79eaf4d609cee4d98710) 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 4ae5808c2f..4d812fbd85 100644
--- a/libavformat/rmdec.c
+++ b/libavformat/rmdec.c
@@ -397,7 +397,11 @@ 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;
}