summaryrefslogtreecommitdiff
path: root/libavcodec/cfhd.c
diff options
context:
space:
mode:
authorKieran Kunhya <kieran@kunhya.com>2016-02-12 00:26:33 +0000
committerKieran Kunhya <kieran@kunhya.com>2016-02-12 01:00:20 +0000
commit1e2fd57fc0967249917e5ec330f22746a75eca64 (patch)
treea7e57be71b83f73897ba6abf78931069d68754d3 /libavcodec/cfhd.c
parentbbc4d069d0ef70102a2e7e7b1c0d3a00f488e666 (diff)
avcodec/cfhd: Fix errors with valid files.
Diffstat (limited to 'libavcodec/cfhd.c')
-rw-r--r--libavcodec/cfhd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/cfhd.c b/libavcodec/cfhd.c
index 5ecfcefba5..5c15d9bb04 100644
--- a/libavcodec/cfhd.c
+++ b/libavcodec/cfhd.c
@@ -312,7 +312,7 @@ static int cfhd_decode(AVCodecContext *avctx, void *data, int *got_frame,
s->plane[s->channel_num].band[0][0].width = data;
s->plane[s->channel_num].band[0][0].stride = data;
av_log(avctx, AV_LOG_DEBUG, "Lowpass width %"PRIu16"\n", data);
- if (data < 2 || (data & 1) || data > s->plane[s->channel_num].band[0][0].a_width) {
+ if (data < 2 || data > s->plane[s->channel_num].band[0][0].a_width) {
av_log(avctx, AV_LOG_ERROR, "Invalid lowpass width\n");
ret = AVERROR(EINVAL);
break;
@@ -358,7 +358,7 @@ static int cfhd_decode(AVCodecContext *avctx, void *data, int *got_frame,
s->plane[s->channel_num].band[s->level][s->subband_num].width = data;
s->plane[s->channel_num].band[s->level][s->subband_num].stride = FFALIGN(data, 8);
av_log(avctx, AV_LOG_DEBUG, "Highpass width %i channel %i level %i subband %i\n", data, s->channel_num, s->level, s->subband_num);
- if (data < 2 || (data & 1)) {
+ if (data < 2) {
av_log(avctx, AV_LOG_ERROR, "Invalid highpass width\n");
ret = AVERROR(EINVAL);
break;
@@ -375,7 +375,7 @@ static int cfhd_decode(AVCodecContext *avctx, void *data, int *got_frame,
s->plane[s->channel_num].band[s->level][s->subband_num].width = data;
s->plane[s->channel_num].band[s->level][s->subband_num].stride = FFALIGN(data, 8);
av_log(avctx, AV_LOG_DEBUG, "Highpass width2 %i\n", data);
- if (data < 2 || (data & 1)) {
+ if (data < 2) {
av_log(avctx, AV_LOG_ERROR, "Invalid highpass width2\n");
ret = AVERROR(EINVAL);
break;