diff options
author | Peter Ross <pross@xvid.org> | 2010-03-04 13:26:01 +0000 |
---|---|---|
committer | Peter Ross <pross@xvid.org> | 2010-03-04 13:26:01 +0000 |
commit | 4ffa6e78c212877abda6856f3c609d00478049df (patch) | |
tree | dee0dce2863995e57d338f387f88e5f0aebdc5d4 /libavformat/bink.c | |
parent | b5e2bb8c3c57de54163311d0c4dcfe38c4f75d04 (diff) | |
download | ffmpeg-4ffa6e78c212877abda6856f3c609d00478049df.tar.gz |
Guard against invalid memory read
Originally committed as revision 22207 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/bink.c')
-rw-r--r-- | libavformat/bink.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/bink.c b/libavformat/bink.c index 035ee6c9ee..efccabde63 100644 --- a/libavformat/bink.c +++ b/libavformat/bink.c @@ -210,7 +210,7 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt) } bink->remain_packet_size -= 4 + audio_size; bink->current_track++; - if (audio_size > 0) { + if (audio_size >= 4) { /* get one audio packet per track */ if ((ret = av_get_packet(pb, pkt, audio_size)) != audio_size) @@ -223,6 +223,8 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt) bink->audio_pts[bink->current_track -1] += AV_RL32(pkt->data) / (2 * s->streams[bink->current_track]->codec->channels); return 0; + } else { + url_fseek(pb, audio_size, SEEK_CUR); } } |