X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fcscd.c;h=6c84f03b4ab74210fe676725f7302450cf18f6a8;hb=c318626ce248e55df032146b16e8e0f4ed1d99fb;hp=3518929c18fc8e04daa29ee4dacd89b56ce1bac9;hpb=975a1447f76e8d30fc01e6ea5466c84faf3d76e4;p=ffmpeg diff --git a/libavcodec/cscd.c b/libavcodec/cscd.c index 3518929c18f..6c84f03b4ab 100644 --- a/libavcodec/cscd.c +++ b/libavcodec/cscd.c @@ -228,7 +228,7 @@ static av_cold int decode_init(AVCodecContext *avctx) { av_log(avctx, AV_LOG_ERROR, "CamStudio codec error: invalid depth %i bpp\n", avctx->bits_per_coded_sample); - return 1; + return AVERROR_INVALIDDATA; } c->bpp = avctx->bits_per_coded_sample; c->pic.data[0] = NULL; @@ -241,7 +241,7 @@ static av_cold int decode_init(AVCodecContext *avctx) { c->decomp_buf = av_malloc(c->decomp_size + AV_LZO_OUTPUT_PADDING); if (!c->decomp_buf) { av_log(avctx, AV_LOG_ERROR, "Can't allocate decompression buffer.\n"); - return 1; + return AVERROR(ENOMEM); } return 0; } @@ -255,15 +255,13 @@ static av_cold int decode_end(AVCodecContext *avctx) { } AVCodec ff_cscd_decoder = { - "camstudio", - AVMEDIA_TYPE_VIDEO, - CODEC_ID_CSCD, - sizeof(CamStudioContext), - decode_init, - NULL, - decode_end, - decode_frame, - CODEC_CAP_DR1, - .long_name = NULL_IF_CONFIG_SMALL("CamStudio"), + .name = "camstudio", + .type = AVMEDIA_TYPE_VIDEO, + .id = AV_CODEC_ID_CSCD, + .priv_data_size = sizeof(CamStudioContext), + .init = decode_init, + .close = decode_end, + .decode = decode_frame, + .capabilities = CODEC_CAP_DR1, + .long_name = NULL_IF_CONFIG_SMALL("CamStudio"), }; -