[FFmpeg-cvslog] lagarith: return more meaningful error codes
Paul B Mahol
git at videolan.org
Tue Jan 22 20:52:10 CET 2013
ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Tue Jan 22 19:48:23 2013 +0000| [c4274d118b1abfeba248c5f4ef3360f265a6d55f] | committer: Paul B Mahol
lagarith: return more meaningful error codes
Signed-off-by: Paul B Mahol <onemda at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c4274d118b1abfeba248c5f4ef3360f265a6d55f
---
libavcodec/lagarith.c | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/libavcodec/lagarith.c b/libavcodec/lagarith.c
index d5470a5..eb8a77e 100644
--- a/libavcodec/lagarith.c
+++ b/libavcodec/lagarith.c
@@ -518,6 +518,7 @@ static int lag_decode_frame(AVCodecContext *avctx,
uint32_t offs[4];
uint8_t *srcs[4], *dst;
int i, j, planes = 3;
+ int ret;
AVFrame *picture = data;
@@ -544,9 +545,9 @@ static int lag_decode_frame(AVCodecContext *avctx,
planes = 4;
}
- if (ff_thread_get_buffer(avctx, p) < 0) {
+ if ((ret = ff_thread_get_buffer(avctx, p)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
- return -1;
+ return ret;
}
dst = p->data[0];
@@ -573,9 +574,9 @@ static int lag_decode_frame(AVCodecContext *avctx,
if (frametype == FRAME_ARITH_RGB24 || frametype == FRAME_U_RGB24)
avctx->pix_fmt = AV_PIX_FMT_RGB24;
- if (ff_thread_get_buffer(avctx, p) < 0) {
+ if ((ret = ff_thread_get_buffer(avctx, p)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
- return -1;
+ return ret;
}
offs[0] = offset_bv;
@@ -632,9 +633,9 @@ static int lag_decode_frame(AVCodecContext *avctx,
case FRAME_ARITH_YUY2:
avctx->pix_fmt = AV_PIX_FMT_YUV422P;
- if (ff_thread_get_buffer(avctx, p) < 0) {
+ if ((ret = ff_thread_get_buffer(avctx, p)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
- return -1;
+ return ret;
}
if (offset_ry >= buf_size ||
@@ -658,9 +659,9 @@ static int lag_decode_frame(AVCodecContext *avctx,
case FRAME_ARITH_YV12:
avctx->pix_fmt = AV_PIX_FMT_YUV420P;
- if (ff_thread_get_buffer(avctx, p) < 0) {
+ if ((ret = ff_thread_get_buffer(avctx, p)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
- return -1;
+ return ret;
}
if (buf_size <= offset_ry || buf_size <= offset_gu || buf_size <= offset_bv) {
return AVERROR_INVALIDDATA;
@@ -687,7 +688,7 @@ static int lag_decode_frame(AVCodecContext *avctx,
default:
av_log(avctx, AV_LOG_ERROR,
"Unsupported Lagarith frame type: %#x\n", frametype);
- return -1;
+ return AVERROR_PATCHWELCOME;
}
*picture = *p;
More information about the ffmpeg-cvslog
mailing list