Commit a9ebdde4 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

mjpeg: minor cosmetics

parent efd7d3f6
......@@ -148,17 +148,16 @@ static char* GetLine( demux_t *p_demux, int *p_pos )
i_size = p_sys->i_data_peeked - *p_pos;
}
}
*p_pos += ( i + 1 );
*p_pos += i + 1;
if( i > 0 && p_buf[i - 1] == '\r' )
{
i--;
}
p_line = malloc( i + 1 );
if( p_line == NULL )
if( unlikely( p_line == NULL ) )
return NULL;
strncpy ( p_line, (char*)p_buf, i );
p_line[i] = '\0';
// msg_Dbg( p_demux, "i = %d, pos = %d, %s", i, *p_pos, p_line );
return p_line;
}
......
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