mirror of
https://github.com/ultravideo/uvg266.git
synced 2024-11-23 18:14:06 +00:00
[cli] Fix yuv_io_seek() buffer type
This commit is contained in:
parent
cd65044000
commit
862cc92e97
|
@ -53,8 +53,7 @@ static void fill_after_frame(unsigned height, unsigned array_width,
|
|||
}
|
||||
|
||||
|
||||
static int read_and_fill_frame_data(
|
||||
FILE* file,
|
||||
static int read_and_fill_frame_data(FILE* file,
|
||||
unsigned width,
|
||||
unsigned height,
|
||||
unsigned bytes_per_sample,
|
||||
|
@ -63,6 +62,7 @@ static int read_and_fill_frame_data(
|
|||
{
|
||||
|
||||
unsigned i;
|
||||
// Handle separately the case where we use UVG_BIT_DEPTH 10+ but the input is 8-bit.
|
||||
if (bytes_per_sample != sizeof(uvg_pixel)) {
|
||||
uint8_t* p = (uint8_t*)data;
|
||||
uint8_t* end = (uint8_t*)data + array_width * height;
|
||||
|
@ -71,7 +71,6 @@ static int read_and_fill_frame_data(
|
|||
// Read the beginning of the line from input.
|
||||
if (width != fread(p, bytes_per_sample, width, file)) return 0;
|
||||
// Fill the rest with the last pixel value.
|
||||
// Fill the rest with the last pixel value.
|
||||
fill_char = p[width - 1];
|
||||
|
||||
for (i = width; i < array_width; ++i) {
|
||||
|
@ -334,7 +333,7 @@ int yuv_io_seek(FILE* file, unsigned frames,
|
|||
|
||||
// Seek failed. Skip data by reading.
|
||||
error = 0;
|
||||
unsigned char* tmp[4096];
|
||||
unsigned char tmp[4096];
|
||||
size_t bytes_left = skip_bytes;
|
||||
while (bytes_left > 0 && !error) {
|
||||
const size_t skip = MIN(4096, bytes_left);
|
||||
|
|
Loading…
Reference in a new issue