summaryrefslogtreecommitdiff
path: root/libavcodec/shorten.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-12-09 00:05:51 +0100
committerMichael Niedermayer <michaelni@gmx.at>2011-12-09 00:05:51 +0100
commit25b9eef410f4a737250dcf2d17b65f6c0c39cd6a (patch)
treea1a8c88aca0b5a88a6fd0c2e9ac1008698f34fea /libavcodec/shorten.c
parentb229485f1ad38162927b235a359b98ff5a0dc13a (diff)
parent6b60a4c9c94bbe03afc8e0851197d97d96f644e5 (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: cljr: K&R cosmetics cljr: return a more sensible value when encountering invalid headers cljr: drop unnecessary emms_c() calls without MMX code cljr: remove useless casts cljr: group encode/decode parts under single ifdefs cljr: remove stray semicolon cljr: add missing return statement in decode_end() doc: add pulseaudio to the input list avconv: remove unsubstantiated comment shorten: avoid abort() on unknown audio types cljr: add encoder build: merge lists of HTML documentation targets tests/examples: Mark some variables only used within their files as static. tests/tools/examples: Replace direct exit() calls by return. x86 cpuid: set vendor union members separately cljr: release picture at end of decoding rv40: NEON optimised rv40 qpel motion compensation Conflicts: doc/examples/muxing.c libavcodec/cljr.c libavcodec/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/shorten.c')
-rw-r--r--libavcodec/shorten.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/libavcodec/shorten.c b/libavcodec/shorten.c
index f0a173cc7e..e0d3f6f986 100644
--- a/libavcodec/shorten.c
+++ b/libavcodec/shorten.c
@@ -176,7 +176,7 @@ static void fix_bitshift(ShortenContext *s, int32_t *buffer)
}
-static void init_offset(ShortenContext *s)
+static int init_offset(ShortenContext *s)
{
int32_t mean = 0;
int chan, i;
@@ -190,12 +190,13 @@ static void init_offset(ShortenContext *s)
break;
default:
av_log(s->avctx, AV_LOG_ERROR, "unknown audio type");
- abort();
+ return AVERROR_INVALIDDATA;
}
for (chan = 0; chan < s->channels; chan++)
for (i = 0; i < nblock; i++)
s->offset[chan][i] = mean;
+ return 0;
}
static int decode_wave_header(AVCodecContext *avctx, const uint8_t *header,
@@ -367,7 +368,8 @@ static int read_header(ShortenContext *s)
if ((ret = allocate_buffers(s)) < 0)
return ret;
- init_offset(s);
+ if ((ret = init_offset(s)) < 0)
+ return ret;
if (s->version > 1)
s->lpcqoffset = V2LPCQOFFSET;