summaryrefslogtreecommitdiff
path: root/libavcodec/wmaprodec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-03-12 16:31:21 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-03-12 16:31:21 +0100
commitbf780b7ea8d9420e39f59d565d283806c31de193 (patch)
tree7e442e73438ccd8a69278cc7d3680b9365c41623 /libavcodec/wmaprodec.c
parentb52421940f5c764237d484c5d578ebc2b1c136c5 (diff)
parent19dd4017ab6dac11c77d797acebee4f60ad63a6f (diff)
Merge commit '19dd4017ab6dac11c77d797acebee4f60ad63a6f'
* commit '19dd4017ab6dac11c77d797acebee4f60ad63a6f': libopencore-amr: Add the missing 3rd argument of ff_get_buffer() vmdaudio: fix invalid reads when packet size is not a multiple of chunk size wmaprodec: return an error, not 0, when the input is too small. Conflicts: libavcodec/vmdav.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/wmaprodec.c')
-rw-r--r--libavcodec/wmaprodec.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c
index afe4661c6b..9a8158f292 100644
--- a/libavcodec/wmaprodec.c
+++ b/libavcodec/wmaprodec.c
@@ -1513,8 +1513,11 @@ static int decode_packet(AVCodecContext *avctx, void *data,
s->packet_done = 0;
/** sanity check for the buffer length */
- if (buf_size < avctx->block_align)
- return 0;
+ if (buf_size < avctx->block_align) {
+ av_log(avctx, AV_LOG_ERROR, "Input packet too small (%d < %d)\n",
+ buf_size, avctx->block_align);
+ return AVERROR_INVALIDDATA;
+ }
s->next_packet_start = buf_size - avctx->block_align;
buf_size = avctx->block_align;