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

Michael Niedermayer git at videolan.org
Thu Feb 12 18:11:49 CET 2015


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

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

diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c
index 19bd7a7..65982ef 100644
--- a/libavformat/rmdec.c
+++ b/libavformat/rmdec.c
@@ -412,7 +412,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