[FFmpeg-cvslog] avformat/rmdec: Check for overflow in ff_rm_read_mdpr_codecdata()

Michael Niedermayer git at videolan.org
Sat Dec 6 00:50:48 CET 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Dec  6 00:18:29 2014 +0100| [03abf55f252945c70f4a79eaf4d609cee4d98710] | committer: Michael Niedermayer

avformat/rmdec: Check for overflow in ff_rm_read_mdpr_codecdata()

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=03abf55f252945c70f4a79eaf4d609cee4d98710
---

 libavformat/rmdec.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c
index e267b01..299c742 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