Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2018-12-31 20:42:06 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2019-01-01 23:11:47 +0300
commit5079eca22a16e91da4c3d7bb1505a894c6ec4dc3 (patch)
tree1881c69d1d8a7165d1e7e4e8e5ca9b4454dffa56 /libavcodec/alac.c
parent8e1b5ba53839dca3951f9760b390456436ef96d1 (diff)
avcodec/alac: Avoid unspecific error codes and forward error codes
Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/alac.c')
-rw-r--r--libavcodec/alac.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libavcodec/alac.c b/libavcodec/alac.c
index 93cf198eea..d6b87db734 100644
--- a/libavcodec/alac.c
+++ b/libavcodec/alac.c
@@ -121,7 +121,7 @@ static int rice_decompress(ALACContext *alac, int32_t *output_buffer,
unsigned int x;
if(get_bits_left(&alac->gb) <= 0)
- return -1;
+ return AVERROR_INVALIDDATA;
/* calculate rice param and decode next value */
k = av_log2((history >> 9) + 3);
@@ -317,7 +317,7 @@ static int decode_element(AVCodecContext *avctx, AVFrame *frame, int ch_index,
if (alac->extra_bits) {
for (i = 0; i < alac->nb_samples; i++) {
if(get_bits_left(&alac->gb) <= 0)
- return -1;
+ return AVERROR_INVALIDDATA;
for (ch = 0; ch < channels; ch++)
alac->extra_bits_buffer[ch][i] = get_bits(&alac->gb, alac->extra_bits);
}
@@ -353,7 +353,7 @@ static int decode_element(AVCodecContext *avctx, AVFrame *frame, int ch_index,
/* not compressed, easy case */
for (i = 0; i < alac->nb_samples; i++) {
if(get_bits_left(&alac->gb) <= 0)
- return -1;
+ return AVERROR_INVALIDDATA;
for (ch = 0; ch < channels; ch++) {
alac->output_samples_buffer[ch][i] =
get_sbits_long(&alac->gb, alac->sample_size);
@@ -555,9 +555,9 @@ static av_cold int alac_decode_init(AVCodecContext * avctx)
av_log(avctx, AV_LOG_ERROR, "extradata is too small\n");
return AVERROR_INVALIDDATA;
}
- if (alac_set_info(alac)) {
+ if ((ret = alac_set_info(alac)) < 0) {
av_log(avctx, AV_LOG_ERROR, "set_info failed\n");
- return -1;
+ return ret;
}
switch (alac->sample_size) {