[FFmpeg-devel] [PATCH] avcodec/cfhd: Fix errors with valid files.

2016-02-11 Thread Kieran Kunhya
---
 libavcodec/cfhd.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/cfhd.c b/libavcodec/cfhd.c
index 0773ffa..6dc22ca 100644
--- a/libavcodec/cfhd.c
+++ b/libavcodec/cfhd.c
@@ -313,7 +313,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;
@@ -354,7 +354,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;
@@ -371,7 +371,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;
-- 
1.9.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avcodec/cfhd: Fix errors with valid files.

2016-02-11 Thread Michael Niedermayer
On Fri, Feb 12, 2016 at 12:26:48AM +, Kieran Kunhya wrote:
> ---
>  libavcodec/cfhd.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

if thats what valid files use then this pretty much must be correct

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

it is not once nor twice but times without number that the same ideas make
their appearance in the world. -- Aristotle


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel