comparison msrle.c @ 1604:21190cfac0e1 libavcodec

100l: sometime palette was not copied to output frame
author rtognimp
date Wed, 05 Nov 2003 23:27:23 +0000
parents 932d306bf1dc
children 9ef0d51e809b
comparison
equal deleted inserted replaced
1603:3a633a3feef6 1604:21190cfac0e1
64 unsigned char stream_byte; 64 unsigned char stream_byte;
65 int pixel_ptr = 0; 65 int pixel_ptr = 0;
66 int row_dec = s->frame.linesize[0]; 66 int row_dec = s->frame.linesize[0];
67 int row_ptr = (s->avctx->height - 1) * row_dec; 67 int row_ptr = (s->avctx->height - 1) * row_dec;
68 int frame_size = row_dec * s->avctx->height; 68 int frame_size = row_dec * s->avctx->height;
69
70 /* make the palette available */
71 memcpy(s->frame.data[1], s->avctx->palctrl->palette, AVPALETTE_SIZE);
72 if (s->avctx->palctrl->palette_changed) {
73 s->frame.palette_has_changed = 1;
74 s->avctx->palctrl->palette_changed = 0;
75 }
69 76
70 while (row_ptr >= 0) { 77 while (row_ptr >= 0) {
71 FETCH_NEXT_STREAM_BYTE(); 78 FETCH_NEXT_STREAM_BYTE();
72 rle_code = stream_byte; 79 rle_code = stream_byte;
73 if (rle_code == 0) { 80 if (rle_code == 0) {
126 pixel_ptr++; 133 pixel_ptr++;
127 } 134 }
128 } 135 }
129 } 136 }
130 137
131 /* make the palette available */
132 memcpy(s->frame.data[1], s->avctx->palctrl->palette, AVPALETTE_SIZE);
133 if (s->avctx->palctrl->palette_changed) {
134 s->frame.palette_has_changed = 1;
135 s->avctx->palctrl->palette_changed = 0;
136 }
137
138 /* one last sanity check on the way out */ 138 /* one last sanity check on the way out */
139 if (stream_ptr < s->size) 139 if (stream_ptr < s->size)
140 av_log(s->avctx, AV_LOG_ERROR, " MS RLE: ended frame decode with bytes left over (%d < %d)\n", 140 av_log(s->avctx, AV_LOG_ERROR, " MS RLE: ended frame decode with bytes left over (%d < %d)\n",
141 stream_ptr, s->size); 141 stream_ptr, s->size);
142 } 142 }