Skip to content

Error in reading y4m files #232

@JoshuaEbenezer

Description

@JoshuaEbenezer

y4m_input.c in daala/tools has an error in reading the headers of y4m files. Line 565 reads the header for 80 characters or until "\n" is reached:

 /*Read until newline, or 80 cols, whichever happens first.*/
  for(i=0;i<79;i++)


The problem is that there is no reason why a y4m header should be less than 80 characters (afaik). I have a y4m file with a long header (more than 80 characters). A quick fix would be increasing this limit to 256.

char buffer[100];
int  ret;
int  i;
int  xstride;
/*Read until newline, or 100 cols, whichever happens first.*/
for(i=0;i<99;i++){ 
  ret=fread(buffer+i,1,1,_fin);
  if(ret<1)return -1;
  if(buffer[i]=='\n')break;
}

See Netflix/vmaf#889 and Netflix/vmaf#890.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions