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

Michael Niedermayer git at videolan.org
Wed Jun 17 22:09:33 CEST 2015


ffmpeg | branch: release/2.2 | Michael Niedermayer <michaelni at gmx.at> | Thu Jun  4 22:59:34 2015 +0200| [c03c2f23b2299eeec48e3e8f9e0d5b74258db58a] | 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=c03c2f23b2299eeec48e3e8f9e0d5b74258db58a
---

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

diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
index b5e748d..a0514ac 100644
--- a/libavcodec/alsdec.c
+++ b/libavcodec/alsdec.c
@@ -1488,6 +1488,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