av_log(avctx, AV_LOG_ERROR, "Inflate reset error: %d\n", zret);
return AVERROR_UNKNOWN;
}
- c->zstream.next_in = (uint8_t *)src;
+ c->zstream.next_in = src;
c->zstream.avail_in = src_len;
c->zstream.next_out = c->decomp_buf + offset;
c->zstream.avail_out = c->decomp_size - offset;
int uqvq, ret;
unsigned int mthread_inlen, mthread_outlen;
unsigned int len = buf_size;
- int linesize;
+ int linesize, offset;
if ((ret = ff_thread_get_buffer(avctx, &tframe, 0)) < 0)
return ret;
/* Convert colorspace */
y_out = frame->data[0] + (height - 1) * frame->linesize[0];
- u_out = frame->data[1] + (height - 1) * frame->linesize[1];
- v_out = frame->data[2] + (height - 1) * frame->linesize[2];
+ offset = (height - 1) * frame->linesize[1];
+ u_out = FF_PTR_ADD(frame->data[1], offset);
+ offset = (height - 1) * frame->linesize[2];
+ v_out = FF_PTR_ADD(frame->data[2], offset);
switch (c->imgtype) {
case IMGTYPE_YUV111:
for (row = 0; row < height; row++) {
return 0;
}
-#if HAVE_THREADS
-static int init_thread_copy(AVCodecContext *avctx)
-{
- return decode_init(avctx);
-}
-#endif
-
static av_cold int decode_end(AVCodecContext *avctx)
{
LclDecContext * const c = avctx->priv_data;
}
#if CONFIG_MSZH_DECODER
-AVCodec ff_mszh_decoder = {
+const AVCodec ff_mszh_decoder = {
.name = "mszh",
.long_name = NULL_IF_CONFIG_SMALL("LCL (LossLess Codec Library) MSZH"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_MSZH,
.priv_data_size = sizeof(LclDecContext),
.init = decode_init,
- .init_thread_copy = ONLY_IF_THREADS_ENABLED(init_thread_copy),
.close = decode_end,
.decode = decode_frame,
.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
#endif
#if CONFIG_ZLIB_DECODER
-AVCodec ff_zlib_decoder = {
+const AVCodec ff_zlib_decoder = {
.name = "zlib",
.long_name = NULL_IF_CONFIG_SMALL("LCL (LossLess Codec Library) ZLIB"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_ZLIB,
.priv_data_size = sizeof(LclDecContext),
.init = decode_init,
- .init_thread_copy = ONLY_IF_THREADS_ENABLED(init_thread_copy),
.close = decode_end,
.decode = decode_frame,
.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,