[FFmpeg-cvslog] wmaprodec: check num_sfb for validity. Fix out of array accesses

Michael Niedermayer git at videolan.org
Wed Nov 14 23:54:41 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Nov 14 21:14:40 2012 +0100| [50f0a6b4e64b78e0df1919ee1fa5e805309911c2] | committer: Michael Niedermayer

wmaprodec: check num_sfb for validity. Fix out of array accesses

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/wmaprodec.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c
index e071eb1..c5cc46b 100644
--- a/libavcodec/wmaprodec.c
+++ b/libavcodec/wmaprodec.c
@@ -412,6 +412,10 @@ static av_cold int decode_init(AVCodecContext *avctx)
         }
         s->sfb_offsets[i][band - 1] = subframe_len;
         s->num_sfb[i]               = band - 1;
+        if (s->num_sfb[i] <= 0) {
+            av_log(avctx, AV_LOG_ERROR, "num_sfb invalid\n");
+            return AVERROR_INVALIDDATA;
+        }
     }
 
 



More information about the ffmpeg-cvslog mailing list