[FFmpeg-cvslog] avcodec/cfhdenc: do not try to encode junk

Paul B Mahol git at videolan.org
Wed Feb 24 18:15:33 EET 2021


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Thu Feb 18 23:42:01 2021 +0100| [33025ab9760aa7ea12d9f8d9bc4d31970a8dc5b3] | committer: Paul B Mahol

avcodec/cfhdenc: do not try to encode junk

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=33025ab9760aa7ea12d9f8d9bc4d31970a8dc5b3
---

 libavcodec/cfhdenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/cfhdenc.c b/libavcodec/cfhdenc.c
index 371f551294..42bbf99c96 100644
--- a/libavcodec/cfhdenc.c
+++ b/libavcodec/cfhdenc.c
@@ -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;



More information about the ffmpeg-cvslog mailing list