openbsd-ports/x11/mplayer/patches/patch-libavformat_4xm_c
sthen 861090a2f7 - SECURITY; fix http://www.trapkit.de/advisories/TKADV2009-004.txt
for the internal ffmpeg.  From Brad.

- sync WANTLIB (gio)
2009-01-29 17:28:13 +00:00

19 lines
949 B
Plaintext

$OpenBSD: patch-libavformat_4xm_c,v 1.1 2009/01/29 17:28:13 sthen Exp $
--- libavformat/4xm.c.orig Thu Jan 29 11:19:43 2009
+++ libavformat/4xm.c Thu Jan 29 11:20:45 2009
@@ -163,10 +163,12 @@ static int fourxm_read_header(AVFormatContext *s,
return AVERROR_INVALIDDATA;
}
current_track = AV_RL32(&header[i + 8]);
+ if((unsigned)current_track >= UINT_MAX / sizeof(AudioTrack) - 1){
+ av_log(s, AV_LOG_ERROR, "current_track too large\n");
+ return -1;
+ }
if (current_track + 1 > fourxm->track_count) {
fourxm->track_count = current_track + 1;
- if((unsigned)fourxm->track_count >= UINT_MAX / sizeof(AudioTrack))
- return -1;
fourxm->tracks = av_realloc(fourxm->tracks,
fourxm->track_count * sizeof(AudioTrack));
if (!fourxm->tracks) {