Commit e5949cc1 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '684e3d2e'

* commit '684e3d2e':
  ra144: check buffer size before requesting a buffer
  wmapro: unref skipped frames
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents ff3e8564 684e3d2e
......@@ -76,6 +76,13 @@ static int ra144_decode_frame(AVCodecContext * avctx, void *data,
RA144Context *ractx = avctx->priv_data;
GetBitContext gb;
if (buf_size < FRAMESIZE) {
av_log(avctx, AV_LOG_ERROR,
"Frame too small (%d bytes). Truncated file?\n", buf_size);
*got_frame_ptr = 0;
return AVERROR_INVALIDDATA;
}
/* get output buffer */
frame->nb_samples = NBLOCKS * BLOCKSIZE;
if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
......@@ -84,12 +91,6 @@ static int ra144_decode_frame(AVCodecContext * avctx, void *data,
}
samples = (int16_t *)frame->data[0];
if(buf_size < FRAMESIZE) {
av_log(avctx, AV_LOG_ERROR,
"Frame too small (%d bytes). Truncated file?\n", buf_size);
*got_frame_ptr = 0;
return buf_size;
}
init_get_bits(&gb, buf, FRAMESIZE * 8);
for (i = 0; i < LPC_ORDER; i++)
......
......@@ -1399,6 +1399,7 @@ static int decode_frame(WMAProDecodeCtx *s, AVFrame *frame, int *got_frame_ptr)
if (s->skip_frame) {
s->skip_frame = 0;
*got_frame_ptr = 0;
av_frame_unref(frame);
} else {
*got_frame_ptr = 1;
}
......
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