X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fxpmdec.c;h=e609a70c6ae281ec7e4918de0531fdddb35c49e5;hb=a247ac640df3da573cd661065bf53f37863e2b46;hp=43dd9bc7e7ea97e1e585ad100e7aa2d41f699438;hpb=34a0a9746b2f441db7c45983838a88aa87a33834;p=ffmpeg diff --git a/libavcodec/xpmdec.c b/libavcodec/xpmdec.c index 43dd9bc7e7e..e609a70c6ae 100644 --- a/libavcodec/xpmdec.c +++ b/libavcodec/xpmdec.c @@ -311,6 +311,7 @@ static int xpm_decode_frame(AVCodecContext *avctx, void *data, int ncolors, cpp, ret, i, j; int64_t size; uint32_t *dst; + int width, height; avctx->pix_fmt = AV_PIX_FMT_BGRA; @@ -332,12 +333,12 @@ static int xpm_decode_frame(AVCodecContext *avctx, void *data, ptr += mod_strcspn(ptr, "\""); if (sscanf(ptr, "\"%u %u %u %u\",", - &avctx->width, &avctx->height, &ncolors, &cpp) != 4) { + &width, &height, &ncolors, &cpp) != 4) { av_log(avctx, AV_LOG_ERROR, "missing image parameters\n"); return AVERROR_INVALIDDATA; } - if ((ret = ff_set_dimensions(avctx, avctx->width, avctx->height)) < 0) + if ((ret = ff_set_dimensions(avctx, width, height)) < 0) return ret; if ((ret = ff_get_buffer(avctx, p, 0)) < 0) @@ -435,7 +436,7 @@ static av_cold int xpm_decode_close(AVCodecContext *avctx) return 0; } -AVCodec ff_xpm_decoder = { +const AVCodec ff_xpm_decoder = { .name = "xpm", .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_XPM,