Error in reading y4m files
JoshuaEbenezer opened this issue · 1 comments
JoshuaEbenezer commented
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.
JoshuaEbenezer commented
Submitted PR #233 to fix this.