Module: libav Branch: release/0.6 Commit: 14fae6eab0e32af483d86fb7c2ac7e69e69d638e
Author: Alex Converse <[email protected]> Committer: Reinhard Tartler <[email protected]> Date: Thu Sep 8 11:02:43 2011 -0700 wavpack: Check error codes rather than working around error conditions. (cherry picked from commit dba2b63a98bdcac7bda1a8a2c48950518c075e17) Signed-off-by: Anton Khirnov <[email protected]> (cherry picked from commit 5d4c065476da547fd1a8a604e3047e1b3a7a29d8) Conflicts: libavcodec/wavpack.c Signed-off-by: Reinhard Tartler <[email protected]> --- libavcodec/wavpack.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c index 968ffa6..db83c44 100644 --- a/libavcodec/wavpack.c +++ b/libavcodec/wavpack.c @@ -997,6 +997,9 @@ static int wavpack_decode_frame(AVCodecContext *avctx, else samplecount = wv_unpack_stereo(s, &s->gb, samples, SAMPLE_FMT_FLT); + if (samplecount < 0) + return -1; + }else{ if(avctx->sample_fmt == SAMPLE_FMT_S16) samplecount = wv_unpack_mono(s, &s->gb, samples, SAMPLE_FMT_S16); @@ -1005,6 +1008,9 @@ static int wavpack_decode_frame(AVCodecContext *avctx, else samplecount = wv_unpack_mono(s, &s->gb, samples, SAMPLE_FMT_FLT); + if (samplecount < 0) + return -1; + if(s->stereo && avctx->sample_fmt == SAMPLE_FMT_S16){ int16_t *dst = (int16_t*)samples + samplecount * 2; int16_t *src = (int16_t*)samples + samplecount; _______________________________________________ libav-commits mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-commits
