[FFmpeg-devel] [PATCH 3/4] avcodec/cfhdenc: do not try to encode junk
Paul B Mahol
onemda at gmail.com
Fri Feb 19 01:02:57 EET 2021
Signed-off-by: Paul B Mahol <onemda at gmail.com>
---
libavcodec/cfhdenc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/cfhdenc.c b/libavcodec/cfhdenc.c
index 9c8ba3700c..b2993cf2a9 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;
--
2.17.1
More information about the ffmpeg-devel
mailing list