avcodec/lcldec: initialize encoded correctly
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 14 Aug 2014 13:18:49 +0000 (15:18 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 14 Aug 2014 13:19:47 +0000 (15:19 +0200)
Fixes out of array read
Fixes: yuv111_no_compr_crash.avi

Found-by: Piotr Bandurski <ami_stuff@o2.pl>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/lcldec.c

index bfab58c..60069d4 100644 (file)
@@ -171,7 +171,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPac
     LclDecContext * const c = avctx->priv_data;
     unsigned int pixel_ptr;
     int row, col;
-    unsigned char *encoded, *outptr;
+    unsigned char *encoded = avpkt->data, *outptr;
     uint8_t *y_out, *u_out, *v_out;
     unsigned int width = avctx->width; // Real image width
     unsigned int height = avctx->height; // Real image height