diff options
author | Diego Biurrun <diego@biurrun.de> | 2014-08-03 11:22:20 -0700 |
---|---|---|
committer | Diego Biurrun <diego@biurrun.de> | 2014-08-03 15:18:58 -0700 |
commit | 6234058148d6e1ee765913b678a22385a87bffac (patch) | |
tree | 15a0059e5a05081fc4f452fc5f258a0e8561d756 /libavcodec | |
parent | 3160bdc7f7bc27bb67561270b4e730cd2d844afd (diff) | |
download | ffmpeg-streaming-6234058148d6e1ee765913b678a22385a87bffac.zip ffmpeg-streaming-6234058148d6e1ee765913b678a22385a87bffac.tar.gz |
huffyuv: Return proper error codes
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/huffyuvdec.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/huffyuvdec.c b/libavcodec/huffyuvdec.c index ebde3ca..4d62ab3 100644 --- a/libavcodec/huffyuvdec.c +++ b/libavcodec/huffyuvdec.c @@ -98,7 +98,7 @@ static int read_len_table(uint8_t *dst, GetBitContext *gb) repeat = get_bits(gb, 8); if (i + repeat > 256 || get_bits_left(gb) < 0) { av_log(NULL, AV_LOG_ERROR, "Error reading huffman table\n"); - return -1; + return AVERROR_INVALIDDATA; } while (repeat--) dst[i++] = val; @@ -261,7 +261,7 @@ static av_cold int decode_init(AVCodecContext *avctx) int method, interlace; if (avctx->extradata_size < 4) - return -1; + return AVERROR_INVALIDDATA; method = avctx->extradata[0]; s->decorrelate = method & 64 ? 1 : 0; @@ -508,7 +508,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, } if ((unsigned) (buf_size - table_size) >= INT_MAX / 8) - return -1; + return AVERROR_INVALIDDATA; init_get_bits(&s->gb, s->bitstream_buffer + table_size, (buf_size - table_size) * 8); |