Merge commit 'a030279a67ef883df8cf3707774656fa1be81078'
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 21 May 2013 09:25:46 +0000 (11:25 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 21 May 2013 09:25:46 +0000 (11:25 +0200)
* commit 'a030279a67ef883df8cf3707774656fa1be81078':
  ljpeg: use the correct number of components in yuv

Conflicts:
libavcodec/mjpegdec.c

See: b2e57eb5a3cb9d5dfab601077fa0edee91e06ca5

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

@@@ -853,17 -710,10 +853,17 @@@ static int ljpeg_decode_rgb_scan(MJpegD
      return 0;
  }
  
- static int ljpeg_decode_yuv_scan(MJpegDecodeContext *s, int nb_components, int predictor,
-                                  int point_transform)
+ static int ljpeg_decode_yuv_scan(MJpegDecodeContext *s, int predictor,
+                                  int point_transform, int nb_components)
  {
      int i, mb_x, mb_y;
 +    int bits= (s->bits+7)&~7;
 +    int resync_mb_y = 0;
 +    int resync_mb_x = 0;
 +
 +    point_transform += bits - s->bits;
 +
 +    av_assert0(nb_components>=1 && nb_components<=3);
  
      for (mb_y = 0; mb_y < s->mb_height; mb_y++) {
          for (mb_x = 0; mb_x < s->mb_width; mb_x++) {
@@@ -1294,10 -1092,13 +1294,12 @@@ next_field
                  return ret;
          } else {
              if (s->rgb) {
 -                if ((ret = ljpeg_decode_rgb_scan(s, predictor,
 -                                                 point_transform)) < 0)
 +                if ((ret = ljpeg_decode_rgb_scan(s, nb_components, predictor, point_transform)) < 0)
                      return ret;
              } else {
-                 if ((ret = ljpeg_decode_yuv_scan(s, nb_components, predictor, point_transform)) < 0)
+                 if ((ret = ljpeg_decode_yuv_scan(s, predictor,
+                                                  point_transform,
+                                                  nb_components)) < 0)
                      return ret;
              }
          }