Revision b641982b libavcodec/rawdec.c

View differences:

libavcodec/rawdec.c
25 25
 */
26 26

  
27 27
#include "avcodec.h"
28
#include "imgconvert.h"
28 29
#include "raw.h"
29 30
#include "libavutil/intreadwrite.h"
31
#include "libavcore/imgutils.h"
30 32

  
31 33
typedef struct RawVideoContext {
32 34
    uint32_t palette[AVPALETTE_COUNT];
......
81 83
    else if (avctx->pix_fmt == PIX_FMT_NONE && avctx->bits_per_coded_sample)
82 84
        avctx->pix_fmt = find_pix_fmt(pix_fmt_bps_avi, avctx->bits_per_coded_sample);
83 85

  
86
    ff_set_systematic_pal(context->palette, avctx->pix_fmt);
84 87
    context->length = avpicture_get_size(avctx->pix_fmt, avctx->width, avctx->height);
85 88
    if((avctx->bits_per_coded_sample == 4 || avctx->bits_per_coded_sample == 2) &&
86 89
       avctx->pix_fmt==PIX_FMT_PAL8 &&
......
148 151
        return -1;
149 152

  
150 153
    avpicture_fill(picture, buf, avctx->pix_fmt, avctx->width, avctx->height);
151
    if(avctx->pix_fmt==PIX_FMT_PAL8 && buf_size < context->length){
154
    if((avctx->pix_fmt==PIX_FMT_PAL8 && buf_size < context->length) ||
155
       (avctx->pix_fmt!=PIX_FMT_PAL8 &&
156
        (av_pix_fmt_descriptors[avctx->pix_fmt].flags & PIX_FMT_PAL))){
152 157
        frame->data[1]= context->palette;
153 158
    }
154 159
    if (avctx->palctrl && avctx->palctrl->palette_changed) {

Also available in: Unified diff