aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-02-14 22:25:48 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-02-14 22:26:00 +0100
commit877c038a9db5e2b7c43b267ce807d81fe3637f7a (patch)
treee7309db85927d9d359e016c99e3e4bf15d7dd7b5 /libavcodec
parentad0be703825762963a6c22047ee693ce78e05cb2 (diff)
parenta96f51f29ac4cd95650a8bcda6c3d5d87c6357fa (diff)
downloadffmpeg-877c038a9db5e2b7c43b267ce807d81fe3637f7a.tar.gz
Merge commit 'a96f51f29ac4cd95650a8bcda6c3d5d87c6357fa'
* commit 'a96f51f29ac4cd95650a8bcda6c3d5d87c6357fa': dca: Return more informative error codes Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/dca_exss.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/libavcodec/dca_exss.c b/libavcodec/dca_exss.c
index c90e9950af..ffccec84c6 100644
--- a/libavcodec/dca_exss.c
+++ b/libavcodec/dca_exss.c
@@ -95,7 +95,7 @@ static int dca_exss_parse_asset_header(DCAContext *s)
int i, j;
if (get_bits_left(&s->gb) < 16)
- return -1;
+ return AVERROR_INVALIDDATA;
/* We will parse just enough to get to the extensions bitmask with which
* we can set the profile value. */
@@ -114,7 +114,7 @@ static int dca_exss_parse_asset_header(DCAContext *s)
* for the asset header size field above was 512 bytes? */
int text_length = get_bits(&s->gb, 10) + 1;
if (get_bits_left(&s->gb) < text_length * 8)
- return -1;
+ return AVERROR_INVALIDDATA;
skip_bits_long(&s->gb, text_length * 8); // info text
}
@@ -147,7 +147,7 @@ static int dca_exss_parse_asset_header(DCAContext *s)
for (i = 0; i < spkr_remap_sets; i++) {
int num_dec_ch_remaps = get_bits(&s->gb, 5) + 1;
if (get_bits_left(&s->gb) < 0)
- return -1;
+ return AVERROR_INVALIDDATA;
for (j = 0; j < num_spkrs[i]; j++) {
int remap_dec_ch_mask = get_bits_long(&s->gb, num_dec_ch_remaps);
@@ -187,7 +187,7 @@ static int dca_exss_parse_asset_header(DCAContext *s)
for (i = 0; i < s->num_mix_configs; i++) {
if (get_bits_left(&s->gb) < 0)
- return -1;
+ return AVERROR_INVALIDDATA;
dca_exss_skip_mix_coeffs(&s->gb, channels, s->mix_config_num_ch[i]);
if (embedded_6ch)
dca_exss_skip_mix_coeffs(&s->gb, 6, s->mix_config_num_ch[i]);
@@ -214,11 +214,11 @@ static int dca_exss_parse_asset_header(DCAContext *s)
/* not parsed further, we were only interested in the extensions mask */
if (get_bits_left(&s->gb) < 0)
- return -1;
+ return AVERROR_INVALIDDATA;
if (get_bits_count(&s->gb) - header_pos > header_size * 8) {
av_log(s->avctx, AV_LOG_WARNING, "Asset header size mismatch.\n");
- return -1;
+ return AVERROR_INVALIDDATA;
}
skip_bits_long(&s->gb, header_pos + header_size * 8 - get_bits_count(&s->gb));