[FFmpeg-cvslog] avcodec/alsdec: Check for overread

Michael Niedermayer git at videolan.org
Thu Aug 20 14:53:38 CEST 2015


ffmpeg | branch: release/2.4 | Michael Niedermayer <michaelni at gmx.at> | Thu Jun  4 22:59:34 2015 +0200| [4121c1db15e121d85a9ed44372948701bbcea78a] | committer: Michael Niedermayer

avcodec/alsdec: Check for overread

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit c2657633187e325a439e3297fd9ccd0522ab2e39)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/alsdec.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
index 7a13a4c..1855f53 100644
--- a/libavcodec/alsdec.c
+++ b/libavcodec/alsdec.c
@@ -1493,6 +1493,11 @@ static int read_frame_data(ALSDecContext *ctx, unsigned int ra_frame)
 
     // TODO: read_diff_float_data
 
+    if (get_bits_left(gb) < 0) {
+        av_log(ctx->avctx, AV_LOG_ERROR, "Overread %d\n", -get_bits_left(gb));
+        return AVERROR_INVALIDDATA;
+    }
+
     return 0;
 }
 



More information about the ffmpeg-cvslog mailing list