X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fpictordec.c;h=33c4545483a7976a30991d1309e3bd55353b75e0;hb=e44b58924fe7b180bf8b0c277c15d1a58210a0e9;hp=322d3d4ad2ed97e049d2aa41508af492192c59dc;hpb=759001c534287a96dc96d1e274665feb7059145d;p=ffmpeg diff --git a/libavcodec/pictordec.c b/libavcodec/pictordec.c index 322d3d4ad2e..33c4545483a 100644 --- a/libavcodec/pictordec.c +++ b/libavcodec/pictordec.c @@ -123,7 +123,7 @@ static int decode_frame(AVCodecContext *avctx, s->nb_planes = (tmp >> 4) + 1; bpp = bits_per_plane * s->nb_planes; if (bits_per_plane > 8 || bpp < 1 || bpp > 32) { - av_log_ask_for_sample(s, "unsupported bit depth\n"); + avpriv_request_sample(avctx, "Unsupported bit depth"); return AVERROR_PATCHWELCOME; } @@ -141,9 +141,9 @@ static int decode_frame(AVCodecContext *avctx, avctx->pix_fmt = AV_PIX_FMT_PAL8; if (s->width != avctx->width && s->height != avctx->height) { - if (av_image_check_size(s->width, s->height, 0, avctx) < 0) - return -1; - avcodec_set_dimensions(avctx, s->width, s->height); + ret = ff_set_dimensions(avctx, s->width, s->height); + if (ret < 0) + return ret; } if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) { @@ -226,16 +226,17 @@ static int decode_frame(AVCodecContext *avctx, if (bits_per_plane == 8) { picmemset_8bpp(s, frame, val, run, &x, &y); if (y < 0) - break; + goto finish; } else { picmemset(s, frame, val, run, &x, &y, &plane, bits_per_plane); } } } } else { - av_log_ask_for_sample(s, "uncompressed image\n"); + avpriv_request_sample(avctx, "Uncompressed image"); return avpkt->size; } +finish: *got_frame = 1; return avpkt->size; @@ -243,10 +244,10 @@ static int decode_frame(AVCodecContext *avctx, AVCodec ff_pictor_decoder = { .name = "pictor", + .long_name = NULL_IF_CONFIG_SMALL("Pictor/PC Paint"), .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_PICTOR, .priv_data_size = sizeof(PicContext), .decode = decode_frame, .capabilities = CODEC_CAP_DR1, - .long_name = NULL_IF_CONFIG_SMALL("Pictor/PC Paint"), };