comparison vb.c @ 10972:3dd1cb77cc60 libavcodec

Use AVPALETTE_COUNT instead of hard-coding 256. This is consistent with other codecs and will also avoid a crash on the memcpy to data[1] if AVPALETTE_SIZE ever increases.
author reimar
date Sat, 23 Jan 2010 15:22:48 +0000
parents d5f811c11f08
children 8a4984c5cacc
comparison
equal deleted inserted replaced
10971:d5f811c11f08 10972:3dd1cb77cc60
41 typedef struct VBDecContext { 41 typedef struct VBDecContext {
42 AVCodecContext *avctx; 42 AVCodecContext *avctx;
43 AVFrame pic; 43 AVFrame pic;
44 44
45 uint8_t *frame, *prev_frame; 45 uint8_t *frame, *prev_frame;
46 uint32_t pal[256]; 46 uint32_t pal[AVPALETTE_COUNT];
47 const uint8_t *stream; 47 const uint8_t *stream;
48 } VBDecContext; 48 } VBDecContext;
49 49
50 static const uint16_t vb_patterns[64] = { 50 static const uint16_t vb_patterns[64] = {
51 0x0660, 0xFF00, 0xCCCC, 0xF000, 0x8888, 0x000F, 0x1111, 0xFEC8, 51 0x0660, 0xFF00, 0xCCCC, 0xF000, 0x8888, 0x000F, 0x1111, 0xFEC8,