[FFmpeg-cvslog] avformat/rmdec: Check for overflow in ff_rm_read_mdpr_codecdata()
Michael Niedermayer
git at videolan.org
Tue Jan 20 03:36:15 CET 2015
ffmpeg | branch: release/2.2 | Michael Niedermayer <michaelni at gmx.at> | Sat Dec 6 00:18:29 2014 +0100| [3e8b73e65bb0f2bec1362b2a78bed7b11d31326e] | committer: Michael Niedermayer
avformat/rmdec: Check for overflow in ff_rm_read_mdpr_codecdata()
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 03abf55f252945c70f4a79eaf4d609cee4d98710)
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3e8b73e65bb0f2bec1362b2a78bed7b11d31326e
---
libavformat/rmdec.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c
index 4ae5808..4d812fb 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;
}
More information about the ffmpeg-cvslog
mailing list