mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-08 13:22:53 +02:00
wnv1: return more meaningful error codes
Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
parent
51bcf8ac85
commit
679c7578a6
@ -66,7 +66,7 @@ static int decode_frame(AVCodecContext *avctx,
|
|||||||
WNV1Context * const l = avctx->priv_data;
|
WNV1Context * const l = avctx->priv_data;
|
||||||
AVFrame * const p = &l->pic;
|
AVFrame * const p = &l->pic;
|
||||||
unsigned char *Y,*U,*V;
|
unsigned char *Y,*U,*V;
|
||||||
int i, j;
|
int i, j, ret;
|
||||||
int prev_y = 0, prev_u = 0, prev_v = 0;
|
int prev_y = 0, prev_u = 0, prev_v = 0;
|
||||||
uint8_t *rbuf;
|
uint8_t *rbuf;
|
||||||
|
|
||||||
@ -78,17 +78,17 @@ static int decode_frame(AVCodecContext *avctx,
|
|||||||
rbuf = av_malloc(buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
|
rbuf = av_malloc(buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
|
||||||
if(!rbuf){
|
if(!rbuf){
|
||||||
av_log(avctx, AV_LOG_ERROR, "Cannot allocate temporary buffer\n");
|
av_log(avctx, AV_LOG_ERROR, "Cannot allocate temporary buffer\n");
|
||||||
return -1;
|
return AVERROR(ENOMEM);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(p->data[0])
|
if(p->data[0])
|
||||||
avctx->release_buffer(avctx, p);
|
avctx->release_buffer(avctx, p);
|
||||||
|
|
||||||
p->reference = 0;
|
p->reference = 0;
|
||||||
if(avctx->get_buffer(avctx, p) < 0){
|
if ((ret = avctx->get_buffer(avctx, p)) < 0) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
|
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
|
||||||
av_free(rbuf);
|
av_free(rbuf);
|
||||||
return -1;
|
return ret;
|
||||||
}
|
}
|
||||||
p->key_frame = 1;
|
p->key_frame = 1;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user