Browse Source

Merge commit 'd1bec4be2207738669874e02605e879ea9620974'

* commit 'd1bec4be2207738669874e02605e879ea9620974':
  wavpack: return an error on 0-sized blocks

Merged-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.0
Michael Niedermayer 12 years ago
parent
commit
f5dfc35157
1 changed files with 1 additions and 6 deletions
  1. +1
    -6
      libavcodec/wavpack.c

+ 1
- 6
libavcodec/wavpack.c View File

@@ -771,11 +771,6 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no,
int i, j, id, size, ssize, weights, t;
int bpp, chan, chmask, orig_bpp;

if (buf_size == 0) {
*got_frame_ptr = 0;
return 0;
}

if (block_no >= wc->fdec_num && wv_alloc_frame_context(wc) < 0) {
av_log(avctx, AV_LOG_ERROR, "Error creating frame decode context\n");
return AVERROR_INVALIDDATA;
@@ -1222,7 +1217,7 @@ static int wavpack_decode_frame(AVCodecContext *avctx, void *data,
frame_size = AV_RL32(buf + 8) + 12;
}
}
if (frame_size < 0 || frame_size > buf_size) {
if (frame_size <= 0 || frame_size > buf_size) {
av_log(avctx, AV_LOG_ERROR,
"Block %d has invalid size (size %d vs. %d bytes left)\n",
s->block, frame_size, buf_size);


Loading…
Cancel
Save