Commit bf780b7e authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '19dd4017'

* commit '19dd4017':
  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: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents b5242194 19dd4017
...@@ -619,7 +619,7 @@ static int vmdaudio_decode_frame(AVCodecContext *avctx, void *data, ...@@ -619,7 +619,7 @@ static int vmdaudio_decode_frame(AVCodecContext *avctx, void *data,
/* decode audio chunks */ /* decode audio chunks */
if (audio_chunks > 0) { if (audio_chunks > 0) {
buf_end = buf + buf_size; buf_end = buf + buf_size;
while ( buf_end - buf >= s->chunk_size) { while (buf_end - buf >= s->chunk_size) {
if (s->out_bps == 2) { if (s->out_bps == 2) {
decode_audio_s16(output_samples_s16, buf, s->chunk_size, decode_audio_s16(output_samples_s16, buf, s->chunk_size,
avctx->channels); avctx->channels);
......
...@@ -1513,8 +1513,11 @@ static int decode_packet(AVCodecContext *avctx, void *data, ...@@ -1513,8 +1513,11 @@ static int decode_packet(AVCodecContext *avctx, void *data,
s->packet_done = 0; s->packet_done = 0;
/** sanity check for the buffer length */ /** sanity check for the buffer length */
if (buf_size < avctx->block_align) if (buf_size < avctx->block_align) {
return 0; 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; s->next_packet_start = buf_size - avctx->block_align;
buf_size = avctx->block_align; buf_size = avctx->block_align;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment