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: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
55c77a0ca3
commit
187630b244
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user