Merge remote branch 'qatar/master'
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 26 Apr 2011 02:12:43 +0000 (04:12 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 26 Apr 2011 02:21:15 +0000 (04:21 +0200)
* qatar/master:
  graphparser: add a NULL check on the argument passed to strstr
  setdar: prefer "sar" over "par" in log info message
  fade: fix draw_slice() check on fade->factor value
  fade: make draw_slice() chroma check against planes 1 and 2
  win32: include the correct header in cmdutils.c
  ac3: fix memleak in fixed-point encoder
  flashsv: Return more meaningful error values.
  flashsv: Employ explicit AVCodec struct initializers.
  read AVI palette from the end of extradata
  cosmetics: K&R coding style and more whitespace for Flash Screen Video

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
cmdutils.c
libavcodec/ac3enc_fixed.c
libavcodec/flashsv.c
libavcodec/flashsvenc.c
libavformat/avidec.c

diff --cc cmdutils.c
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -590,14 -588,18 +590,18 @@@ static int avi_read_header(AVFormatCont
  
                      /* Extract palette from extradata if bpp <= 8. */
                      /* This code assumes that extradata contains only palette. */
 -                    /* This is true for all paletted codecs implemented in Libav. */
 +                    /* This is true for all paletted codecs implemented in FFmpeg. */
                      if (st->codec->extradata_size && (st->codec->bits_per_coded_sample <= 8)) {
+                         int pal_size = (1 << st->codec->bits_per_coded_sample) << 2;
+                         const uint8_t *pal_src;
+                         pal_size = FFMIN(pal_size, st->codec->extradata_size);
+                         pal_src = st->codec->extradata + st->codec->extradata_size - pal_size;
  #if HAVE_BIGENDIAN
-                         for (i = 0; i < FFMIN(st->codec->extradata_size, AVPALETTE_SIZE)/4; i++)
-                             ast->pal[i] = av_bswap32(((uint32_t*)st->codec->extradata)[i]);
+                         for (i = 0; i < pal_size/4; i++)
 -                            ast->pal[i] = av_bswap32(((uint32_t*)pal_src)[i]);
++                            ast->pal[i] = AV_RL32(pal_src+4*i);
  #else
-                         memcpy(ast->pal, st->codec->extradata,
-                                FFMIN(st->codec->extradata_size, AVPALETTE_SIZE));
+                         memcpy(ast->pal, pal_src, pal_size);
  #endif
                          ast->has_pal = 1;
                      }