aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-06-04 22:59:34 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-06-10 02:13:12 +0200
commita3740b6a8644198d9c61f9080f4fa407d37531b8 (patch)
tree9fbc5baf3bd77e1d4683033302cb0b118ab13c45 /libavcodec
parentff0e9060a53fc3c8fdcb40c4314e61b381a1b269 (diff)
downloadffmpeg-a3740b6a8644198d9c61f9080f4fa407d37531b8.tar.gz
avcodec/alsdec: Check for overread
Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit c2657633187e325a439e3297fd9ccd0522ab2e39) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/alsdec.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
index bfadf70e0d..b1f6b3a435 100644
--- a/libavcodec/alsdec.c
+++ b/libavcodec/alsdec.c
@@ -1468,6 +1468,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;
}