Skip to content

Commit

Permalink
[cli] Fix yuv_io_seek() buffer type
Browse files Browse the repository at this point in the history
  • Loading branch information
fador committed Sep 5, 2024
1 parent cd65044 commit 862cc92
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/yuv_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,16 @@ static void fill_after_frame(unsigned height, unsigned array_width,
}


static int read_and_fill_frame_data(
FILE* file,
unsigned width,
unsigned height,
unsigned bytes_per_sample,
unsigned array_width,
uvg_pixel* data)
static int read_and_fill_frame_data(FILE* file,
unsigned width,
unsigned height,
unsigned bytes_per_sample,
unsigned array_width,
uvg_pixel* 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;
Expand All @@ -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) {
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 862cc92

Please sign in to comment.