aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/dca.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2017-10-31 00:36:32 -0300
committerJames Almer <jamrial@gmail.com>2017-11-01 18:36:53 -0300
commit3df4939988ace682f7ac0366ef8fd700d207e6b6 (patch)
tree309709c0eb5b1e4f98d79a9d5f705609f8bff2cb /libavcodec/dca.c
parent2b739e1cb8f6ce8baead03ce5c999103ba78f24f (diff)
downloadffmpeg-3df4939988ace682f7ac0366ef8fd700d207e6b6.tar.gz
avcodec/dca: return standard error codes in avpriv_dca_parse_core_frame_header()
This prevents making the DCAParseError enum part of the ABI. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Reviewed-by: foo86 <foobaz86@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/dca.c')
-rw-r--r--libavcodec/dca.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/libavcodec/dca.c b/libavcodec/dca.c
index 942fe6c3c9..a0729e61ab 100644
--- a/libavcodec/dca.c
+++ b/libavcodec/dca.c
@@ -149,9 +149,14 @@ int ff_dca_parse_core_frame_header(DCACoreFrameHeader *h, GetBitContext *gb)
int avpriv_dca_parse_core_frame_header(DCACoreFrameHeader *h, const uint8_t *buf, int size)
{
GetBitContext gb;
+ int ret;
- if (init_get_bits8(&gb, buf, size) < 0)
- return DCA_PARSE_ERROR_INVALIDDATA;
+ ret = init_get_bits8(&gb, buf, size);
+ if (ret < 0)
+ return ret;
- return ff_dca_parse_core_frame_header(h, &gb);
+ if (ff_dca_parse_core_frame_header(h, &gb) < 0)
+ return AVERROR_INVALIDDATA;
+
+ return 0;
}