aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-05-28 11:28:18 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-05-28 11:28:22 +0200
commitf5dfc3515780a4b59d82138d098cb8a4ae50cc98 (patch)
tree2c48349639c7225aa97bfa4ce1266fecdd9e4529 /libavcodec
parent2ba0953ee4bdc478e7ec1bd42bfa3aed7d810442 (diff)
parentd1bec4be2207738669874e02605e879ea9620974 (diff)
downloadffmpeg-f5dfc3515780a4b59d82138d098cb8a4ae50cc98.tar.gz
Merge commit 'd1bec4be2207738669874e02605e879ea9620974'
* commit 'd1bec4be2207738669874e02605e879ea9620974': wavpack: return an error on 0-sized blocks Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/wavpack.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c
index e80f4c5f6a..9cddf4b4b0 100644
--- a/libavcodec/wavpack.c
+++ b/libavcodec/wavpack.c
@@ -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);