aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/rtjpeg.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-08-14 11:51:28 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-08-14 11:51:42 +0200
commitd12bc01ec55a78b33ab9bef8377ae6adff03354a (patch)
tree83492fd83fad0da53ed7d6e36b935faab74f3d96 /libavcodec/rtjpeg.c
parent8da4305eb520bb4624df633ef124089fcfba8e6d (diff)
parent62cc7a91080194d9ead162516f779f20931220d9 (diff)
downloadffmpeg-d12bc01ec55a78b33ab9bef8377ae6adff03354a.tar.gz
Merge commit '62cc7a91080194d9ead162516f779f20931220d9'
* commit '62cc7a91080194d9ead162516f779f20931220d9': rtjpeg: return meaningful error codes Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/rtjpeg.c')
-rw-r--r--libavcodec/rtjpeg.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/rtjpeg.c b/libavcodec/rtjpeg.c
index fe781ce25e..e8fcfc6d7a 100644
--- a/libavcodec/rtjpeg.c
+++ b/libavcodec/rtjpeg.c
@@ -56,7 +56,7 @@ static inline int get_block(GetBitContext *gb, int16_t *block, const uint8_t *sc
// number of non-zero coefficients
coeff = get_bits(gb, 6);
if (get_bits_left(gb) < (coeff << 1))
- return -1;
+ return AVERROR_INVALIDDATA;
// normally we would only need to clear the (63 - coeff) last values,
// but since we do not know where they are we just clear the whole block
@@ -73,7 +73,7 @@ static inline int get_block(GetBitContext *gb, int16_t *block, const uint8_t *sc
// 4 bits per coefficient
ALIGN(4);
if (get_bits_left(gb) < (coeff << 2))
- return -1;
+ return AVERROR_INVALIDDATA;
while (coeff) {
ac = get_sbits(gb, 4);
if (ac == -8)
@@ -84,7 +84,7 @@ static inline int get_block(GetBitContext *gb, int16_t *block, const uint8_t *sc
// 8 bits per coefficient
ALIGN(8);
if (get_bits_left(gb) < (coeff << 3))
- return -1;
+ return AVERROR_INVALIDDATA;
while (coeff) {
ac = get_sbits(gb, 8);
PUT_COEFF(ac);