On 2014-10-25 23:02, Vittorio Giovara wrote:
On Sat, Oct 25, 2014 at 9:46 PM, Tomas Härdin
<tomas.har...@codemill.se> wrote:
On Fri, 2014-10-24 at 13:11 +0100, Vittorio Giovara wrote:
On Fri, Oct 24, 2014 at 7:15 AM, Anton Khirnov <an...@khirnov.net>
wrote:
> Quoting Vittorio Giovara (2014-10-24 01:05:58)
>> CC: libav-sta...@libav.org
>> Bug-Id: CID 732262
>> ---
>> libavformat/mxfdec.c | 5 +++--
>> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> Eh? Looks very much like a no-op.
It's a little noop, ofs is an even value and it is increased by two
at
every loop, so in the original code ofs gets to 16 when at the last
operation. Coverity gets a little confused and warns that 16 is out
of
bounds.
I can drop this if preferred and mark a false positive if preferred.
It doesn't fix anything and makes the code uglier. Perhaps change it
to
ofs <= 14? That makes the code clearer and should make coverity happy.
/Tomas
Care to send a small patch for that? :)
Alternatively I can just mark it a false positive.
Here you go
/Tomas
From 9aa8675f2e2964185044dcd3543a9e601b5fff4d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tomas=20H=C3=A4rdin?= <tomas.har...@codemill.se>
Date: Mon, 27 Oct 2014 13:59:13 +0100
Subject: [PATCH] mxfdec: Increase coverity happiness and readability of
mxf_read_pixel_layout()
---
libavformat/mxfdec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index ff88f91..b71c80f 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -816,7 +816,7 @@ static void mxf_read_pixel_layout(AVIOContext *pb,
MXFDescriptor *descriptor)
value = avio_r8(pb);
av_dlog(NULL, "pixel layout: code %#x\n", code);
- if (ofs < 16) {
+ if (ofs <= 14) {
layout[ofs++] = code;
layout[ofs++] = value;
}
--
1.9.1
_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel