summaryrefslogtreecommitdiff
path: root/libavcodec/flicvideo.c
diff options
context:
space:
mode:
authorSteven Johnson <>2006-11-24 00:16:32 +0000
committerAlex Beregszaszi <alex@rtfs.hu>2006-11-24 00:16:32 +0000
commitfce2200da05d66d59f3e34e5af836a7c7550cb44 (patch)
treece48daafaa46d2347103b9d9da5af04b2bcc3516 /libavcodec/flicvideo.c
parent37e6f5f321d2c0a0bd6b21fb4c19cba366061a59 (diff)
downloadffmpeg-fce2200da05d66d59f3e34e5af836a7c7550cb44.tar.gz
Implement DELTA_FLI opcodes correctly. Patch by Steven Johnson
Originally committed as revision 7165 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/flicvideo.c')
-rw-r--r--libavcodec/flicvideo.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/libavcodec/flicvideo.c b/libavcodec/flicvideo.c
index 6a80a15767..9cbc4f3f32 100644
--- a/libavcodec/flicvideo.c
+++ b/libavcodec/flicvideo.c
@@ -246,9 +246,15 @@ static int flic_decode_frame_8BPP(AVCodecContext *avctx,
while (compressed_lines > 0) {
line_packets = LE_16(&buf[stream_ptr]);
stream_ptr += 2;
- if (line_packets < 0) {
+ if ((line_packets & 0xC000) == 0xC000) {
+ // line skip opcode
line_packets = -line_packets;
y_ptr += line_packets * s->frame.linesize[0];
+ } else if ((line_packets & 0xC000) == 0x4000) {
+ av_log(avctx, AV_LOG_ERROR, "Undefined opcode (%x) in DELTA_FLI\n", line_packets);
+ } else if ((line_packets & 0xC000) == 0x8000) {
+ // "last byte" opcode
+ pixels[y_ptr + s->frame.linesize[0] - 1] = line_packets & 0xff;
} else {
compressed_lines--;
pixel_ptr = y_ptr;