diff options
Diffstat (limited to 'libavcodec/bfi.c')
-rw-r--r-- | libavcodec/bfi.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libavcodec/bfi.c b/libavcodec/bfi.c index 70291b563b..231ee62204 100644 --- a/libavcodec/bfi.c +++ b/libavcodec/bfi.c @@ -57,16 +57,16 @@ static int bfi_decode_frame(AVCodecContext *avctx, void *data, uint8_t *src, *dst_offset, colour1, colour2; uint8_t *frame_end = bfi->dst + avctx->width * avctx->height; uint32_t *pal; - int i, j, height = avctx->height; + int i, j, ret, height = avctx->height; if (bfi->frame.data[0]) avctx->release_buffer(avctx, &bfi->frame); bfi->frame.reference = 3; - if (ff_get_buffer(avctx, &bfi->frame) < 0) { + if ((ret = ff_get_buffer(avctx, &bfi->frame)) < 0) { av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); - return -1; + return ret; } bytestream2_init(&g, avpkt->data, buf_size); @@ -78,7 +78,7 @@ static int bfi_decode_frame(AVCodecContext *avctx, void *data, /* Setting the palette */ if (avctx->extradata_size > 768) { av_log(NULL, AV_LOG_ERROR, "Palette is too large.\n"); - return -1; + return AVERROR_INVALIDDATA; } pal = (uint32_t *)bfi->frame.data[1]; for (i = 0; i < avctx->extradata_size / 3; i++) { @@ -109,7 +109,7 @@ static int bfi_decode_frame(AVCodecContext *avctx, void *data, if (!bytestream2_get_bytes_left(&g)) { av_log(avctx, AV_LOG_ERROR, "Input resolution larger than actual frame.\n"); - return -1; + return AVERROR_INVALIDDATA; } /* Get length and offset (if required) */ @@ -135,7 +135,7 @@ static int bfi_decode_frame(AVCodecContext *avctx, void *data, case 0: // normal chain if (length >= bytestream2_get_bytes_left(&g)) { av_log(avctx, AV_LOG_ERROR, "Frame larger than buffer.\n"); - return -1; + return AVERROR_INVALIDDATA; } bytestream2_get_buffer(&g, dst, length); dst += length; |