[FFmpeg-cvslog] avformat/rmdec: Check for overflow in ff_rm_read_mdpr_codecdata()
Michael Niedermayer
git at videolan.org
Sun Jan 18 00:36:50 CET 2015
ffmpeg | branch: release/2.4 | Michael Niedermayer <michaelni at gmx.at> | Sat Dec 6 00:18:29 2014 +0100| [564d943b2755a00df6857a86eb57101609f4b5a0] | 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=564d943b2755a00df6857a86eb57101609f4b5a0
---
libavformat/rmdec.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c
index d281228..59bbef6 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;
}
More information about the ffmpeg-cvslog
mailing list