Fix remotely exploitable arbitrary code execution vulnerability.
Found by Tobias Klein / tk // trapkit / de / See: http://www.trapkit.de/advisories/TKADV2009-004.txt Originally committed as revision 16846 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
@@ -166,12 +166,13 @@ static int fourxm_read_header(AVFormatContext *s,
|
|||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
current_track = AV_RL32(&header[i + 8]);
|
current_track = AV_RL32(&header[i + 8]);
|
||||||
if (current_track + 1 > fourxm->track_count) {
|
if((unsigned)current_track >= UINT_MAX / sizeof(AudioTrack) - 1){
|
||||||
fourxm->track_count = current_track + 1;
|
av_log(s, AV_LOG_ERROR, "current_track too large\n");
|
||||||
if((unsigned)fourxm->track_count >= UINT_MAX / sizeof(AudioTrack)){
|
|
||||||
ret= -1;
|
ret= -1;
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
if (current_track + 1 > fourxm->track_count) {
|
||||||
|
fourxm->track_count = current_track + 1;
|
||||||
fourxm->tracks = av_realloc(fourxm->tracks,
|
fourxm->tracks = av_realloc(fourxm->tracks,
|
||||||
fourxm->track_count * sizeof(AudioTrack));
|
fourxm->track_count * sizeof(AudioTrack));
|
||||||
if (!fourxm->tracks) {
|
if (!fourxm->tracks) {
|
||||||
|
|||||||
Reference in New Issue
Block a user