s->avctx = avctx;
/* width needs to be divisible by 4 for this codec to work */
if (avctx->width & 0x3)
- return -1;
+ return AVERROR(EINVAL);
avctx->pix_fmt = AV_PIX_FMT_YUV422P;
avcodec_get_frame_defaults(&s->frame);
AuraDecodeContext *s = avctx->priv_data;
uint8_t *Y, *U, *V;
uint8_t val;
- int x, y;
+ int x, y, ret;
const uint8_t *buf = pkt->data;
/* prediction error tables (make it clear that they are signed values) */
if (pkt->size != 48 + avctx->height * avctx->width) {
av_log(avctx, AV_LOG_ERROR, "got a buffer with %d bytes when %d were expected\n",
pkt->size, 48 + avctx->height * avctx->width);
- return -1;
+ return AVERROR_INVALIDDATA;
}
/* pixel data starts 48 bytes in, after 3x16-byte tables */
s->frame.buffer_hints = FF_BUFFER_HINTS_VALID;
s->frame.reference = 0;
- if (ff_get_buffer(avctx, &s->frame) < 0) {
+ if ((ret = ff_get_buffer(avctx, &s->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
- return -1;
+ return ret;
}
Y = s->frame.data[0];