1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

flashsv: Return more meaningful error values.

This commit is contained in:
Diego Biurrun 2011-04-25 16:01:58 +02:00
parent 46cb2da1f0
commit a14c08247d
2 changed files with 4 additions and 4 deletions

View File

@ -133,7 +133,7 @@ static int flashsv_decode_frame(AVCodecContext *avctx, void *data,
av_free(s->tmpblock);
if ((s->tmpblock = av_malloc(3 * s->block_width * s->block_height)) == NULL) {
av_log(avctx, AV_LOG_ERROR, "Can't allocate decompression buffer.\n");
return -1;
return AVERROR(ENOMEM);
}
}
s->block_size = s->block_width * s->block_height;

View File

@ -106,7 +106,7 @@ static av_cold int flashsv_encode_init(AVCodecContext *avctx)
if ((avctx->width > 4095) || (avctx->height > 4095)) {
av_log(avctx, AV_LOG_ERROR, "Input dimensions too large, input must be max 4096x4096 !\n");
return -1;
return AVERROR_INVALIDDATA;
}
// Needed if zlib unused or init aborted before deflateInit
@ -122,7 +122,7 @@ static av_cold int flashsv_encode_init(AVCodecContext *avctx)
if (!s->tmpblock || !s->encbuffer) {
av_log(avctx, AV_LOG_ERROR, "Memory allocation failed.\n");
return -1;
return AVERROR(ENOMEM);
}
return 0;
@ -222,7 +222,7 @@ static int flashsv_encode_frame(AVCodecContext *avctx, uint8_t *buf,
s->previous_frame = av_mallocz(FFABS(p->linesize[0]) * s->image_height);
if (!s->previous_frame) {
av_log(avctx, AV_LOG_ERROR, "Memory allocation failed.\n");
return -1;
return AVERROR(ENOMEM);
}
I_frame = 1;
}