[FFmpeg-cvslog] matroskadec: prevent potential integer overflow

Michael Niedermayer git at videolan.org
Sun Aug 5 18:02:51 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Aug  5 17:04:59 2012 +0200| [c30f53e4d8156f1a1e2b15b3d5504c4a67a88d5f] | committer: Michael Niedermayer

matroskadec: prevent potential integer overflow

Iam not sure this can happen, but its safer we check.

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

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

 libavformat/matroskadec.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 0f18087..500048f 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -1580,7 +1580,7 @@ static int matroska_read_header(AVFormatContext *s)
                    && (track->codec_priv.data != NULL)) {
             fourcc = AV_RL32(track->codec_priv.data);
             codec_id = ff_codec_get_id(ff_codec_movvideo_tags, fourcc);
-        } else if (codec_id == CODEC_ID_ALAC && track->codec_priv.size) {
+        } else if (codec_id == CODEC_ID_ALAC && track->codec_priv.size && track->codec_priv.size < INT_MAX-12) {
             /* Only ALAC's magic cookie is stored in Matroska's track headers.
                Create the "atom size", "tag", and "tag version" fields the
                decoder expects manually. */



More information about the ffmpeg-cvslog mailing list