[FFmpeg-cvslog] wavpack: Check error codes rather than working around error conditions.
Alex Converse
git at videolan.org
Sun Dec 25 01:36:00 CET 2011
ffmpeg | branch: release/0.6 | Alex Converse <alex.converse at gmail.com> | Thu Sep 8 11:02:43 2011 -0700| [14fae6eab0e32af483d86fb7c2ac7e69e69d638e] | committer: Reinhard Tartler
wavpack: Check error codes rather than working around error conditions.
(cherry picked from commit dba2b63a98bdcac7bda1a8a2c48950518c075e17)
Signed-off-by: Anton Khirnov <anton at khirnov.net>
(cherry picked from commit 5d4c065476da547fd1a8a604e3047e1b3a7a29d8)
Conflicts:
libavcodec/wavpack.c
Signed-off-by: Reinhard Tartler <siretart at tauware.de>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=14fae6eab0e32af483d86fb7c2ac7e69e69d638e
---
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;
More information about the ffmpeg-cvslog
mailing list