mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-03-28 12:32:17 +02:00
bethsoftvideo: return meaningful error codes.
This commit is contained in:
parent
e83c1e2d0b
commit
fc2a94c15e
@ -75,9 +75,9 @@ static int bethsoftvid_decode_frame(AVCodecContext *avctx,
|
|||||||
int code, ret;
|
int code, ret;
|
||||||
int yoffset;
|
int yoffset;
|
||||||
|
|
||||||
if (avctx->reget_buffer(avctx, &vid->frame)) {
|
if ((ret = avctx->reget_buffer(avctx, &vid->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;
|
||||||
}
|
}
|
||||||
wrap_to_next_line = vid->frame.linesize[0] - avctx->width;
|
wrap_to_next_line = vid->frame.linesize[0] - avctx->width;
|
||||||
|
|
||||||
@ -105,7 +105,7 @@ static int bethsoftvid_decode_frame(AVCodecContext *avctx,
|
|||||||
case VIDEO_YOFF_P_FRAME:
|
case VIDEO_YOFF_P_FRAME:
|
||||||
yoffset = bytestream2_get_le16(&vid->g);
|
yoffset = bytestream2_get_le16(&vid->g);
|
||||||
if(yoffset >= avctx->height)
|
if(yoffset >= avctx->height)
|
||||||
return -1;
|
return AVERROR_INVALIDDATA;
|
||||||
dst += vid->frame.linesize[0] * yoffset;
|
dst += vid->frame.linesize[0] * yoffset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user