Merge commit 'da4f5d9d77882bee568266d764b95b51f81b7871' into release/2.2
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 20 Dec 2014 11:59:29 +0000 (12:59 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 20 Dec 2014 11:59:41 +0000 (12:59 +0100)
* commit 'da4f5d9d77882bee568266d764b95b51f81b7871':
  mjpegdec: check for pixel format changes

Conflicts:
libavcodec/mjpegdec.c

See: 5c378d6a6df8243f06c87962b873bd563e58cd39
See: a2f680c7bc7642c687aeb4e14d00ac74833c7a09
Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavcodec/mjpegdec.c

@@@ -239,17 -215,13 +239,17 @@@ int ff_mjpeg_decode_dht(MJpegDecodeCont
  
  int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
  {
-     int h_count[MAX_COMPONENTS];
-     int v_count[MAX_COMPONENTS];
 +    int len, nb_components, i, width, height, bits, pix_fmt_id, ret;
 -    int len, nb_components, i, width, height, bits, pix_fmt_id, ret;
+     int h_count[MAX_COMPONENTS] = { 0 };
+     int v_count[MAX_COMPONENTS] = { 0 };
 +
 +    s->cur_scan = 0;
 +    s->upscale_h = s->upscale_v = 0;
  
      /* XXX: verify len field validity */
      len     = get_bits(&s->gb, 16);
-     bits = get_bits(&s->gb, 8);
 +    s->avctx->bits_per_raw_sample =
+     bits    = get_bits(&s->gb, 8);
  
      if (s->pegasus_rct)
          bits = 9;
          return AVERROR_PATCHWELCOME;
      }
  
 -    if (s->v_max == 1 && s->h_max == 1 && s->lossless == 1)
 -        s->rgb = 1;
  
      /* if different size, realloc/alloc picture */
-     if (   width != s->width || height != s->height
-         || bits != s->bits
-         || memcmp(s->h_count, h_count, sizeof(h_count))
-         || memcmp(s->v_count, v_count, sizeof(v_count))) {
+     if (width != s->width || height != s->height || bits != s->bits ||
+         memcmp(s->h_count, h_count, sizeof(h_count))                ||
+         memcmp(s->v_count, v_count, sizeof(v_count))) {
 +
          s->width      = width;
          s->height     = height;
          s->bits       = bits;