[FFmpeg-cvslog] wmavoice: validate block alignment
Andreas Cadhalpun
git at videolan.org
Tue Jan 3 02:00:51 EET 2017
ffmpeg | branch: master | Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com> | Sun Jan 1 22:48:38 2017 +0100| [e8651f51aa46268613b328c60079e16d992e013f] | committer: Andreas Cadhalpun
wmavoice: validate block alignment
This prevents a division by zero crash in wmavoice_decode_packet.
The problem was introduced by commit
3deb4b54a24f8cddce463d9f5751b01efeb976af.
Reviewed-by: Ronald S. Bultje <rsbultje at gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e8651f51aa46268613b328c60079e16d992e013f
---
libavcodec/wmavoice.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/libavcodec/wmavoice.c b/libavcodec/wmavoice.c
index c310b19..c2390a9 100644
--- a/libavcodec/wmavoice.c
+++ b/libavcodec/wmavoice.c
@@ -388,6 +388,11 @@ static av_cold int wmavoice_decode_init(AVCodecContext *ctx)
ctx->extradata_size);
return AVERROR_INVALIDDATA;
}
+ if (ctx->block_align <= 0) {
+ av_log(ctx, AV_LOG_ERROR, "Invalid block alignment %d.\n", ctx->block_align);
+ return AVERROR_INVALIDDATA;
+ }
+
flags = AV_RL32(ctx->extradata + 18);
s->spillover_bitsize = 3 + av_ceil_log2(ctx->block_align);
s->do_apf = flags & 0x1;
More information about the ffmpeg-cvslog
mailing list