Browse Source

bfi: Add some very basic sanity checks for input packet sizes

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
tags/n2.1
Martin Storsjö 12 years ago
parent
commit
640a2427aa
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      libavformat/bfi.c

+ 4
- 0
libavformat/bfi.c View File

@@ -132,6 +132,10 @@ static int bfi_read_packet(AVFormatContext * s, AVPacket * pkt)
video_offset = avio_rl32(pb); video_offset = avio_rl32(pb);
audio_size = video_offset - audio_offset; audio_size = video_offset - audio_offset;
bfi->video_size = chunk_size - video_offset; bfi->video_size = chunk_size - video_offset;
if (audio_size < 0 || bfi->video_size < 0) {
av_log(s, AV_LOG_ERROR, "Invalid audio/video offsets or chunk size\n");
return AVERROR_INVALIDDATA;
}


//Tossing an audio packet at the audio decoder. //Tossing an audio packet at the audio decoder.
ret = av_get_packet(pb, pkt, audio_size); ret = av_get_packet(pb, pkt, audio_size);


Loading…
Cancel
Save