/* * * Init smacker decoder * */ static av_cold int decode_init(AVCodecContext *avctx) { SmackVContext * const c = avctx->priv_data; c->avctx = avctx; c->pic.data[0] = NULL; if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) { return 1; } avctx->pix_fmt = PIX_FMT_PAL8; /* decode huffman trees from extradata */ if(avctx->extradata_size < 16){ av_log(avctx, AV_LOG_ERROR, "Extradata missing!\n"); return -1; } decode_header_trees(c); return 0; }
static av_cold int decode_init(AVCodecContext *avctx) { SmackVContext * const c = avctx->priv_data; int ret; c->avctx = avctx; avctx->pix_fmt = AV_PIX_FMT_PAL8; c->pic = av_frame_alloc(); if (!c->pic) return AVERROR(ENOMEM); /* decode huffman trees from extradata */ if(avctx->extradata_size < 16){ av_log(avctx, AV_LOG_ERROR, "Extradata missing!\n"); decode_end(avctx); return AVERROR(EINVAL); } ret = decode_header_trees(c); if (ret < 0) { decode_end(avctx); return ret; } return 0; }
/* * * Init smacker decoder * */ static av_cold int decode_init(AVCodecContext *avctx) { SmackVContext * const c = avctx->priv_data; c->avctx = avctx; avctx->pix_fmt = AV_PIX_FMT_PAL8; /* decode huffman trees from extradata */ if(avctx->extradata_size < 16){ av_log(avctx, AV_LOG_ERROR, "Extradata missing!\n"); return -1; } if (decode_header_trees(c)) return -1; return 0; }
/* * * Init smacker decoder * */ static av_cold int decode_init(AVCodecContext *avctx) { SmackVContext * const c = avctx->priv_data; c->avctx = avctx; avctx->pix_fmt = AV_PIX_FMT_PAL8; avcodec_get_frame_defaults(&c->pic); /* decode huffman trees from extradata */ if(avctx->extradata_size < 16){ av_log(avctx, AV_LOG_ERROR, "Extradata missing!\n"); return AVERROR(EINVAL); } if (decode_header_trees(c)) return AVERROR_INVALIDDATA; return 0; }