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

Michael Niedermayer git at videolan.org
Wed Feb 4 17:17:53 CET 2015


ffmpeg | branch: release/1.2 | Michael Niedermayer <michaelni at gmx.at> | Sat Dec  6 00:18:29 2014 +0100| [abfa41618124b8ead869f727346d9aaecab73ca8] | 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=abfa41618124b8ead869f727346d9aaecab73ca8
---

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

diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c
index 06a327e..bea0ced 100644
--- a/libavformat/rmdec.c
+++ b/libavformat/rmdec.c
@@ -389,7 +389,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