]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/cfhdenc: do not try to encode junk
authorPaul B Mahol <onemda@gmail.com>
Thu, 18 Feb 2021 22:42:01 +0000 (23:42 +0100)
committerPaul B Mahol <onemda@gmail.com>
Wed, 24 Feb 2021 16:14:03 +0000 (17:14 +0100)
libavcodec/cfhdenc.c

index 371f551294df46213bf0e973b5127a91905a4c77..42bbf99c96b7c6e6f585a4b336b14b17ca47002d 100644 (file)
@@ -742,7 +742,7 @@ static int cfhd_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
 
                 for (int m = 0; m < height; m++) {
                     for (int j = 0; j < stride; j++) {
-                        int16_t index = FFSIGN(data[j]) * lut[FFABS(data[j])];
+                        int16_t index = j >= width ? 0 : FFSIGN(data[j]) * lut[FFABS(data[j])];
 
                         if (index < 0)
                             index += 512;