Commit c17e8f68 authored by stefano's avatar stefano

Make iff.c:decode_init return the value returned by

avctx->get_buffer() in case of error, rather than AVERROR_UNKNOWN
which is deprecated, and mark AVERROR_UNKNOWN for deletion at the next
major bump.

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@22512 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 2f368c53
...@@ -61,6 +61,7 @@ int ff_cmap_read_palette(AVCodecContext *avctx, uint32_t *pal) ...@@ -61,6 +61,7 @@ int ff_cmap_read_palette(AVCodecContext *avctx, uint32_t *pal)
static av_cold int decode_init(AVCodecContext *avctx) static av_cold int decode_init(AVCodecContext *avctx)
{ {
IffContext *s = avctx->priv_data; IffContext *s = avctx->priv_data;
int err;
if (avctx->bits_per_coded_sample <= 8) { if (avctx->bits_per_coded_sample <= 8) {
avctx->pix_fmt = PIX_FMT_PAL8; avctx->pix_fmt = PIX_FMT_PAL8;
...@@ -76,9 +77,9 @@ static av_cold int decode_init(AVCodecContext *avctx) ...@@ -76,9 +77,9 @@ static av_cold int decode_init(AVCodecContext *avctx)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
s->frame.reference = 1; s->frame.reference = 1;
if (avctx->get_buffer(avctx, &s->frame) < 0) { if ((err = avctx->get_buffer(avctx, &s->frame) < 0)) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return AVERROR_UNKNOWN; return err;
} }
return avctx->bits_per_coded_sample <= 8 ? return avctx->bits_per_coded_sample <= 8 ?
......
...@@ -33,7 +33,11 @@ ...@@ -33,7 +33,11 @@
#define AVERROR(e) (e) #define AVERROR(e) (e)
#define AVUNERROR(e) (e) #define AVUNERROR(e) (e)
#endif #endif
#if LIBAVUTIL_VERSION_MAJOR < 51
#define AVERROR_UNKNOWN AVERROR(EINVAL) /**< unknown error */ #define AVERROR_UNKNOWN AVERROR(EINVAL) /**< unknown error */
#endif
#define AVERROR_IO AVERROR(EIO) /**< I/O error */ #define AVERROR_IO AVERROR(EIO) /**< I/O error */
#define AVERROR_NUMEXPECTED AVERROR(EDOM) /**< Number syntax expected in filename. */ #define AVERROR_NUMEXPECTED AVERROR(EDOM) /**< Number syntax expected in filename. */
#define AVERROR_INVALIDDATA AVERROR(EINVAL) /**< invalid data found */ #define AVERROR_INVALIDDATA AVERROR(EINVAL) /**< invalid data found */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment