Skip to content

Commit b36082e

Browse files
committed
nemo-directory-async.c: Don't write the entire buffer into the
pixbuf loader all at once. Ref: #2756 Thanks to Johan Croft <[email protected]> for discovering a fix: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=996805#10
1 parent 33fab16 commit b36082e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libnemo-private/nemo-directory-async.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3902,7 +3902,7 @@ get_pixbuf_for_content (goffset file_len,
39023902
gboolean res;
39033903
GdkPixbuf *pixbuf, *pixbuf2;
39043904
GdkPixbufLoader *loader;
3905-
gsize chunk_len;
3905+
gsize chunk_len = 4096;
39063906
pixbuf = NULL;
39073907

39083908
loader = gdk_pixbuf_loader_new ();
@@ -3913,7 +3913,7 @@ get_pixbuf_for_content (goffset file_len,
39133913
/* For some reason we have to write in chunks, or gdk-pixbuf fails */
39143914
res = TRUE;
39153915
while (res && file_len > 0) {
3916-
chunk_len = file_len;
3916+
chunk_len = (file_len > chunk_len) ? chunk_len : file_len;
39173917
res = gdk_pixbuf_loader_write (loader, (guchar *) file_contents, chunk_len, NULL);
39183918
file_contents += chunk_len;
39193919
file_len -= chunk_len;

0 commit comments

Comments
 (0)