int lines;
int compressed_lines;
int starting_line;
- signed short line_packets;
+ int line_packets;
int y_ptr;
int byte_run;
int pixel_skip;
bytestream2_init(&g2, buf, buf_size);
- if ((ret = ff_reget_buffer(avctx, s->frame)) < 0)
+ if ((ret = ff_reget_buffer(avctx, s->frame, 0)) < 0)
return ret;
pixels = s->frame->data[0];
break;
if (y_ptr > pixel_limit)
return AVERROR_INVALIDDATA;
- line_packets = bytestream2_get_le16(&g2);
+ line_packets = sign_extend(bytestream2_get_le16(&g2), 16);
if ((line_packets & 0xC000) == 0xC000) {
// line skip opcode
line_packets = -line_packets;
int lines;
int compressed_lines;
- signed short line_packets;
+ int line_packets;
int y_ptr;
int byte_run;
int pixel_skip;
bytestream2_init(&g2, buf, buf_size);
- if ((ret = ff_reget_buffer(avctx, s->frame)) < 0)
+ if ((ret = ff_reget_buffer(avctx, s->frame, 0)) < 0)
return ret;
pixels = s->frame->data[0];
break;
if (y_ptr > pixel_limit)
return AVERROR_INVALIDDATA;
- line_packets = bytestream2_get_le16(&g2);
+ line_packets = sign_extend(bytestream2_get_le16(&g2), 16);
if (line_packets < 0) {
line_packets = -line_packets;
if (line_packets > s->avctx->height)
int lines;
int compressed_lines;
- signed short line_packets;
+ int line_packets;
int y_ptr;
int byte_run;
int pixel_skip;
bytestream2_init(&g2, buf, buf_size);
- if ((ret = ff_reget_buffer(avctx, s->frame)) < 0)
+ if ((ret = ff_reget_buffer(avctx, s->frame, 0)) < 0)
return ret;
pixels = s->frame->data[0];
break;
if (y_ptr > pixel_limit)
return AVERROR_INVALIDDATA;
- line_packets = bytestream2_get_le16(&g2);
+ line_packets = sign_extend(bytestream2_get_le16(&g2), 16);
if (line_packets < 0) {
line_packets = -line_packets;
if (line_packets > s->avctx->height)
} else {
if (bytestream2_tell(&g2) + 2*byte_run > stream_ptr_after_chunk)
break;
- CHECK_PIXEL_PTR(2 * byte_run);
+ CHECK_PIXEL_PTR(3 * byte_run);
for (j = 0; j < byte_run; j++, pixel_countdown--) {
pixel = bytestream2_get_le24(&g2);
AV_WL24(&pixels[pixel_ptr], pixel);
for (y_ptr = 0; y_ptr < s->frame->linesize[0] * s->avctx->height;
y_ptr += s->frame->linesize[0]) {
- pixel_countdown = s->avctx->width;
- pixel_ptr = 0;
- while (pixel_countdown > 0) {
- pixel = bytestream2_get_le24(&g2);
- AV_WL24(&pixels[y_ptr + pixel_ptr], pixel);
- pixel_ptr += 3;
- pixel_countdown--;
- }
+ bytestream2_get_buffer(&g2, pixels + y_ptr, 3*s->avctx->width);
if (s->avctx->width & 1)
bytestream2_skip(&g2, 3);
}
return 0;
}
-AVCodec ff_flic_decoder = {
+const AVCodec ff_flic_decoder = {
.name = "flic",
.long_name = NULL_IF_CONFIG_SMALL("Autodesk Animator Flic video"),
.type = AVMEDIA_TYPE_VIDEO,