Skip to content
Snippets Groups Projects
Commit 18009e60 authored by Anton Khirnov's avatar Anton Khirnov
Browse files

aasc: return meaningful error codes.

parent 313da47a
No related branches found
No related tags found
No related merge requests found
...@@ -56,13 +56,13 @@ static int aasc_decode_frame(AVCodecContext *avctx, ...@@ -56,13 +56,13 @@ static int aasc_decode_frame(AVCodecContext *avctx,
const uint8_t *buf = avpkt->data; const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size; int buf_size = avpkt->size;
AascContext *s = avctx->priv_data; AascContext *s = avctx->priv_data;
int compr, i, stride; int compr, i, stride, ret;
s->frame.reference = 1; s->frame.reference = 1;
s->frame.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE; s->frame.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE;
if (avctx->reget_buffer(avctx, &s->frame)) { if ((ret = avctx->reget_buffer(avctx, &s->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n"); av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
return -1; return ret;
} }
compr = AV_RL32(buf); compr = AV_RL32(buf);
...@@ -82,7 +82,7 @@ static int aasc_decode_frame(AVCodecContext *avctx, ...@@ -82,7 +82,7 @@ static int aasc_decode_frame(AVCodecContext *avctx,
break; break;
default: default:
av_log(avctx, AV_LOG_ERROR, "Unknown compression type %d\n", compr); av_log(avctx, AV_LOG_ERROR, "Unknown compression type %d\n", compr);
return -1; return AVERROR_INVALIDDATA;
} }
*got_frame = 1; *got_frame = 1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment