From 6d24fe2c3c7437bfbf8317d3de5bdd4af9823589 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Mon, 16 Apr 2012 01:24:04 +0200 Subject: [PATCH] segafilm: make the loop condition in film_read_packet() match the contents. Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer --- libavformat/segafilm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/segafilm.c b/libavformat/segafilm.c index c0a5e0f81e..9c171f0b50 100644 --- a/libavformat/segafilm.c +++ b/libavformat/segafilm.c @@ -290,7 +290,7 @@ static int film_read_packet(AVFormatContext *s, left = 0; right = sample->sample_size / 2; - for (i = 0; i < sample->sample_size; ) { + for (i = 0; i + 1 + 2*(film->audio_bits != 8) < sample->sample_size; ) { if (film->audio_bits == 8) { pkt->data[i++] = film->stereo_buffer[left++]; pkt->data[i++] = film->stereo_buffer[right++];