summaryrefslogtreecommitdiff
path: root/libavcodec/targa_y216dec.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/targa_y216dec.c')
-rw-r--r--libavcodec/targa_y216dec.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/libavcodec/targa_y216dec.c b/libavcodec/targa_y216dec.c
index 67d19a1181..38694ce39e 100644
--- a/libavcodec/targa_y216dec.c
+++ b/libavcodec/targa_y216dec.c
@@ -36,17 +36,15 @@ static int y216_decode_frame(AVCodecContext *avctx, void *data,
AVFrame *pic = data;
const uint16_t *src = (uint16_t *)avpkt->data;
uint16_t *y, *u, *v, aligned_width = FFALIGN(avctx->width, 4);
- int i, j;
+ int i, j, ret;
if (avpkt->size < 4 * avctx->height * aligned_width) {
av_log(avctx, AV_LOG_ERROR, "Insufficient input data.\n");
return AVERROR(EINVAL);
}
- if (ff_get_buffer(avctx, pic, 0) < 0) {
- av_log(avctx, AV_LOG_ERROR, "Could not allocate buffer.\n");
- return AVERROR(ENOMEM);
- }
+ if ((ret = ff_get_buffer(avctx, pic, 0)) < 0)
+ return ret;
pic->key_frame = 1;
pic->pict_type = AV_PICTURE_TYPE_I;