From f7813a5324be39d13ab536c245d15dfc602a7849 Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Sun, 29 Dec 2013 12:19:38 +0000 Subject: basic type mechanism working --- ffmpeg/libavcodec/sunrast.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'ffmpeg/libavcodec/sunrast.c') diff --git a/ffmpeg/libavcodec/sunrast.c b/ffmpeg/libavcodec/sunrast.c index 1e25b60..d9918f4 100644 --- a/ffmpeg/libavcodec/sunrast.c +++ b/ffmpeg/libavcodec/sunrast.c @@ -61,10 +61,6 @@ static int sunrast_decode_frame(AVCodecContext *avctx, void *data, av_log(avctx, AV_LOG_ERROR, "invalid (compression) type\n"); return AVERROR_INVALIDDATA; } - if (av_image_check_size(w, h, 0, avctx)) { - av_log(avctx, AV_LOG_ERROR, "invalid image size\n"); - return AVERROR_INVALIDDATA; - } if (maptype == RMT_RAW) { avpriv_request_sample(avctx, "Unknown colormap type"); return AVERROR_PATCHWELCOME; @@ -100,8 +96,10 @@ static int sunrast_decode_frame(AVCodecContext *avctx, void *data, return AVERROR_INVALIDDATA; } - if (w != avctx->width || h != avctx->height) - avcodec_set_dimensions(avctx, w, h); + ret = ff_set_dimensions(avctx, w, h); + if (ret < 0) + return ret; + if ((ret = ff_get_buffer(avctx, p, 0)) < 0) return ret; @@ -209,9 +207,9 @@ static int sunrast_decode_frame(AVCodecContext *avctx, void *data, AVCodec ff_sunrast_decoder = { .name = "sunrast", + .long_name = NULL_IF_CONFIG_SMALL("Sun Rasterfile image"), .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_SUNRAST, .decode = sunrast_decode_frame, .capabilities = CODEC_CAP_DR1, - .long_name = NULL_IF_CONFIG_SMALL("Sun Rasterfile image"), }; -- cgit v1.2.3