Revision 62931e11

View differences:

libavcodec/anm.c
29 29

  
30 30
typedef struct AnmContext {
31 31
    AVFrame frame;
32
    int palette[AVPALETTE_COUNT];
32 33
    int x;  ///< x coordinate position
33 34
} AnmContext;
34 35

  
......
44 45
        return -1;
45 46

  
46 47
    s->frame.reference = 1;
47
    if (avctx->get_buffer(avctx, &s->frame) < 0) {
48
        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
49
        return -1;
50
    }
51 48

  
52 49
    buf = avctx->extradata + 16*8;
53 50
    for (i = 0; i < 256; i++)
54
        ((uint32_t*)s->frame.data[1])[i] = bytestream_get_le32(&buf);
51
        s->palette[i] = bytestream_get_le32(&buf);
55 52

  
56 53
    return 0;
57 54
}
......
170 167
        }
171 168
    } while (buf + 1 < buf_end);
172 169

  
170
    memcpy(s->frame.data[1], s->palette, AVPALETTE_SIZE);
171

  
173 172
    *data_size = sizeof(AVFrame);
174 173
    *(AVFrame*)data = s->frame;
175 174
    return buf_size;

Also available in: Unified diff