Merge commit '5f7aecde02a95451e514c809f2794c1deba80695'
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 3 Sep 2013 12:00:28 +0000 (14:00 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 3 Sep 2013 12:12:53 +0000 (14:12 +0200)
* commit '5f7aecde02a95451e514c809f2794c1deba80695':
  pictordec: break out of both decoding loops when y drops below 0

Conflicts:
libavcodec/pictordec.c

The added check is redundant.
It shows the error path more clearly though

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

@@@ -231,21 -232,11 +233,22 @@@ static int decode_frame(AVCodecContext 
                  }
              }
          }
 +
 +        if (x < avctx->width && y >= 0) {
 +            int run = (y + 1) * avctx->width - x;
 +            if (bits_per_plane == 8)
 +                picmemset_8bpp(s, frame, val, run, &x, &y);
 +            else
 +                picmemset(s, frame, val, run / (8 / bits_per_plane), &x, &y, &plane, bits_per_plane);
 +        }
      } else {
 -        avpriv_request_sample(s, "Uncompressed image");
 -        return avpkt->size;
 +        while (y >= 0 && bytestream2_get_bytes_left(&s->g) > 0) {
 +            memcpy(frame->data[0] + y * frame->linesize[0], s->g.buffer, FFMIN(avctx->width, bytestream2_get_bytes_left(&s->g)));
 +            bytestream2_skip(&s->g, avctx->width);
 +            y--;
 +        }
      }
+ finish:
  
      *got_frame      = 1;
      return avpkt->size;