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

Michael Niedermayer git at videolan.org
Thu Jun 4 23:12:21 CEST 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Jun  4 22:59:34 2015 +0200| [c2657633187e325a439e3297fd9ccd0522ab2e39] | committer: Michael Niedermayer

avcodec/alsdec: Check for overread

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

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

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

diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
index 75be55c..b7d147d 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