int x2, idx;
for (; get_bits_left(&g) > 0;) {
- if ((show_bits(&g, 24) & 0xfff000) == 0xfff000)
+ if (show_bits(&g, 12) == 0xfff)
break;
skip_bits(&g, 8);
}
- shiftreg = show_bits_long(&g, 32) & 0xffffff00;
- while (shiftreg != 0xfffffe00) {
+ shiftreg = show_bits(&g, 24);
+ while (shiftreg != 0xfffffe) {
if (get_bits_left(&g) <= 0)
return AVERROR_INVALIDDATA;
skip_bits(&g, 1);
- shiftreg = show_bits_long(&g, 32) & 0xffffff00;
+ shiftreg = show_bits(&g, 24);
}
- skip_bits(&g, 16);
- y = show_bits_long(&g, 23) & 0x1fff;
- skip_bits(&g, 8);
+ skip_bits(&g, 24);
+ y = show_bits(&g, 15) & 0x1fff;
if (y >= height)
break;
type = get_bits(&g, 2);
else
s->resolution = av_clip(4 - s->lowres, 0, 4);
- avctx->width = img_info[s->resolution].width;
- avctx->height = img_info[s->resolution].height;
+ ret = ff_set_dimensions(avctx, img_info[s->resolution].width, img_info[s->resolution].height);
+ if (ret < 0)
+ return ret;
if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0)
return ret;
.decode = photocd_decode_frame,
.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
.long_name = NULL_IF_CONFIG_SMALL("Kodak Photo CD"),
+ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};