mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-25 13:11:13 +00:00
When calling fread() in a loop, check for ferror() as well as for feof()
2004-04-13 Matthias Clasen <mclasen@redhat.com> * io-ani.c (gdk_pixbuf__ani_image_load_animation): * gdk-pixbuf-io.c (gdk_pixbuf_get_file_info) (_gdk_pixbuf_generic_image_load) (gdk_pixbuf_new_from_file_at_size): When calling fread() in a loop, check for ferror() as well as for feof() to avoid infinite loops on directories. (#137804, Alex Converse)
This commit is contained in:
parent
ec726796a5
commit
fe8c42b69e
@ -1,3 +1,12 @@
|
||||
2004-04-13 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* io-ani.c (gdk_pixbuf__ani_image_load_animation):
|
||||
* gdk-pixbuf-io.c (gdk_pixbuf_get_file_info)
|
||||
(_gdk_pixbuf_generic_image_load)
|
||||
(gdk_pixbuf_new_from_file_at_size): When calling fread()
|
||||
in a loop, check for ferror() as well as for feof() to
|
||||
avoid infinite loops on directories. (#137804, Alex Converse)
|
||||
|
||||
Mon Mar 15 15:01:59 2004 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* === Released 2.4.0 ===
|
||||
|
@ -698,7 +698,7 @@ _gdk_pixbuf_generic_image_load (GdkPixbufModule *module,
|
||||
if (!context)
|
||||
return NULL;
|
||||
|
||||
while (!feof (f)) {
|
||||
while (!feof (f) && !ferror (f)) {
|
||||
length = fread (buffer, 1, sizeof (buffer), f);
|
||||
if (length > 0)
|
||||
if (!module->load_increment (context, buffer, length, error)) {
|
||||
@ -911,7 +911,7 @@ gdk_pixbuf_new_from_file_at_size (const char *filename,
|
||||
|
||||
g_signal_connect (loader, "size-prepared", G_CALLBACK (size_prepared_cb), &info);
|
||||
|
||||
while (!feof (f)) {
|
||||
while (!feof (f) && !ferror (f)) {
|
||||
length = fread (buffer, 1, sizeof (buffer), f);
|
||||
if (length > 0)
|
||||
if (!gdk_pixbuf_loader_write (loader, buffer, length, error)) {
|
||||
@ -1012,7 +1012,7 @@ gdk_pixbuf_get_file_info (const gchar *filename,
|
||||
|
||||
g_signal_connect (loader, "size-prepared", G_CALLBACK (info_cb), &info);
|
||||
|
||||
while (!feof (f)) {
|
||||
while (!feof (f) && !ferror (f)) {
|
||||
length = fread (buffer, 1, sizeof (buffer), f);
|
||||
if (length > 0) {
|
||||
if (!gdk_pixbuf_loader_write (loader, buffer, length, NULL))
|
||||
|
@ -626,7 +626,7 @@ gdk_pixbuf__ani_image_load_animation (FILE *f, GError **error)
|
||||
if (!context)
|
||||
return NULL;
|
||||
|
||||
while (!feof (f)) {
|
||||
while (!feof (f) && !ferror (f)) {
|
||||
length = fread (buffer, 1, sizeof (buffer), f);
|
||||
if (length > 0)
|
||||
if (!gdk_pixbuf__ani_image_load_increment (context, buffer, length, error)) {
|
||||
|
Loading…
Reference in New Issue
Block a user