libavcodec/ljpegenc.c:149: error: Buffer Overrun L1
  Offset: -1 Size: `pict->data[*].length`.

libavcodec/ljpegenc.c:40:1: <Length trace>
38. 
39. 
40. static int encode_picture_lossless(AVCodecContext *avctx, AVPacket *pkt,
    ^
41.                                    const AVFrame *pict, int *got_packet)
42. {

libavcodec/ljpegenc.c:40:1: Parameter `*pict->data[*]`
38. 
39. 
40. static int encode_picture_lossless(AVCodecContext *avctx, AVPacket *pkt,
    ^
41.                                    const AVFrame *pict, int *got_packet)
42. {

libavcodec/ljpegenc.c:144:33: Assignment
142.                                 int pred;
143. 
144.                                 ptr = p->data[i] + (linesize * (v * mb_y + y)) + (h * mb_x + x); //FIXME optimize this crap
                                     ^
145.                                 if(y==0 && mb_y==0){
146.                                     if(x==0 && mb_x==0){

libavcodec/ljpegenc.c:149:47: Array access: Offset: -1 Size: pict->data[*].length
147.                                         pred= 128;
148.                                     }else{
149.                                         pred= ptr[-1];
                                                   ^
150.                                     }
151.                                 }else{
