We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 980bd4c commit f177b5fCopy full SHA for f177b5f
src/image-gif.c
@@ -465,7 +465,8 @@ static void read_ext(twin_gif_t *gif)
465
{
466
uint8_t label;
467
468
- read(gif->fd, &label, 1);
+ if (read(gif->fd, &label, 1) < 1)
469
+ return;
470
switch (label) {
471
case 0x01:
472
read_plain_text_ext(gif);
@@ -494,11 +495,11 @@ static int gif_get_frame(twin_gif_t *gif)
494
495
while (sep != ',') {
496
if (sep == ';')
497
return 0;
- if (sep == '!')
498
- read_ext(gif);
499
- else
+ if (sep != '!')
+ return -1;
500
+ read_ext(gif);
501
+ if (read(gif->fd, &sep, 1) < 1)
502
return -1;
- read(gif->fd, &sep, 1);
503
}
504
if (read_image(gif) == -1)
505
0 commit comments