summaryrefslogtreecommitdiff
path: root/libavcodec/cfhdenc.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2021-02-18 23:42:01 +0100
committerPaul B Mahol <onemda@gmail.com>2021-02-24 17:14:03 +0100
commit33025ab9760aa7ea12d9f8d9bc4d31970a8dc5b3 (patch)
tree7230eb0b4681ede774d5a6ea6affc158fc203b62 /libavcodec/cfhdenc.c
parentfbfa78508bec11e231b3e276dcc716fe654baca3 (diff)
avcodec/cfhdenc: do not try to encode junk
Diffstat (limited to 'libavcodec/cfhdenc.c')
-rw-r--r--libavcodec/cfhdenc.c2
1 files changed, 1 insertions, 1 deletions
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;