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

kgv1dec: return meaningful error codes.

parent e1a7061d
No related branches found
No related tags found
No related merge requests found
...@@ -55,14 +55,14 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, ...@@ -55,14 +55,14 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
int w, h, i, res; int w, h, i, res;
if (avpkt->size < 2) if (avpkt->size < 2)
return -1; return AVERROR_INVALIDDATA;
w = (buf[0] + 1) * 8; w = (buf[0] + 1) * 8;
h = (buf[1] + 1) * 8; h = (buf[1] + 1) * 8;
buf += 2; buf += 2;
if (av_image_check_size(w, h, 0, avctx)) if ((res = av_image_check_size(w, h, 0, avctx)) < 0)
return -1; return res;
if (w != avctx->width || h != avctx->height) { if (w != avctx->width || h != avctx->height) {
if (c->prev.data[0]) if (c->prev.data[0])
......
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