[FFmpeg-cvslog] binkaudio: prevent extradata overread

Paul B Mahol git at videolan.org
Sat Jun 9 12:44:19 CEST 2012


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Sat Jun  9 10:30:31 2012 +0000| [c2dd01c16fb13aed5f4896bbe14ea65db5d66862] | committer: Paul B Mahol

binkaudio: prevent extradata overread

Signed-off-by: Paul B Mahol <onemda at gmail.com>

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

 libavcodec/binkaudio.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/binkaudio.c b/libavcodec/binkaudio.c
index ee66b8b..591c6ab 100644
--- a/libavcodec/binkaudio.c
+++ b/libavcodec/binkaudio.c
@@ -96,7 +96,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
         return AVERROR_INVALIDDATA;
     }
 
-    s->version_b = avctx->extradata && avctx->extradata[3] == 'b';
+    s->version_b = avctx->extradata_size >= 4 && avctx->extradata[3] == 'b';
 
     if (avctx->codec->id == CODEC_ID_BINKAUDIO_RDFT) {
         // audio is already interleaved for the RDFT format variant



More information about the ffmpeg-cvslog mailing list