[FFmpeg-cvslog] shorten: set invalid channels count to 0

Reinhard Tartler git at videolan.org
Sun Sep 22 17:32:15 CEST 2013


ffmpeg | branch: release/0.8 | Reinhard Tartler <siretart at tauware.de> | Tue May  7 07:26:19 2013 +0200| [a694b2b15865f6fd42217c82146e1be43f3b3f9b] | committer: Reinhard Tartler

shorten: set invalid channels count to 0

Prevent the loop shorten_decode_close from writing and freeing out of
the array boundary.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Luca Barbato <lu_zero at gentoo.org>

CC: libav-stable at libav.org

(cherry picked from commit c10da30d8426a1f681d99a780b6e311f7fb4e5c5)
(cherry picked from commit 21d568be179c54a1596d1377b4da7fbe755bfe7f)

Signed-off-by: Luca Barbato <lu_zero at gentoo.org>

Conflicts:
	libavcodec/shorten.c

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a694b2b15865f6fd42217c82146e1be43f3b3f9b
---

 libavcodec/shorten.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/libavcodec/shorten.c b/libavcodec/shorten.c
index cb3d09d..b12d6e6 100644
--- a/libavcodec/shorten.c
+++ b/libavcodec/shorten.c
@@ -344,6 +344,7 @@ static int shorten_decode_frame(AVCodecContext *avctx,
         s->channels = get_uint(s, CHANSIZE);
         if (s->channels <= 0 || s->channels > MAX_CHANNELS) {
             av_log(s->avctx, AV_LOG_ERROR, "too many channels: %d\n", s->channels);
+            s->channels = 0;
             return -1;
         }
 



More information about the ffmpeg-cvslog mailing list