Commit 187630b2 authored by Tomas Härdin's avatar Tomas Härdin Committed by Michael Niedermayer

mxfdec: Fix CID 732262

Coverity thinks ofs can end up 15, thus writing past the end of layout[]. This
is incorrect since it's always incremented by 2. Checking ofs <= 14 makes
Coverity happy and doesn't hurt.
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 55c77a0c
...@@ -782,14 +782,14 @@ static int mxf_read_index_table_segment(void *arg, AVIOContext *pb, int tag, int ...@@ -782,14 +782,14 @@ static int mxf_read_index_table_segment(void *arg, AVIOContext *pb, int tag, int
static void mxf_read_pixel_layout(AVIOContext *pb, MXFDescriptor *descriptor) static void mxf_read_pixel_layout(AVIOContext *pb, MXFDescriptor *descriptor)
{ {
int code, value, ofs = 0; int code, value, ofs = 0;
char layout[16] = {0}; char layout[16] = {0}; /* not for printing, may end up not terminated on purpose */
do { do {
code = avio_r8(pb); code = avio_r8(pb);
value = avio_r8(pb); value = avio_r8(pb);
av_dlog(NULL, "pixel layout: code %#x\n", code); av_dlog(NULL, "pixel layout: code %#x\n", code);
if (ofs < 16) { if (ofs <= 14) {
layout[ofs++] = code; layout[ofs++] = code;
layout[ofs++] = value; layout[ofs++] = value;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment