mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-24 14:36:13 +01:00
Use correct offset for buffer data in GConverterOutputStream
Otherwise we overwrite already converted data in the case that more than one call to g_converter_convert is necessary in write() or flush(). https://bugzilla.gnome.org/show_bug.cgi?id=619945
This commit is contained in:
parent
86592d675f
commit
6858ab2033
@ -427,7 +427,7 @@ g_converter_output_stream_write (GOutputStream *stream,
|
||||
res = g_converter_convert (priv->converter,
|
||||
to_convert + converted_bytes,
|
||||
to_convert_size - converted_bytes,
|
||||
buffer_data (&priv->converted_buffer),
|
||||
buffer_data (&priv->converted_buffer) + buffer_available (&priv->converted_buffer),
|
||||
buffer_tailspace (&priv->converted_buffer),
|
||||
0,
|
||||
&bytes_read,
|
||||
@ -542,7 +542,7 @@ g_converter_output_stream_flush (GOutputStream *stream,
|
||||
res = g_converter_convert (priv->converter,
|
||||
buffer_data (&priv->output_buffer),
|
||||
buffer_available (&priv->output_buffer),
|
||||
buffer_data (&priv->converted_buffer),
|
||||
buffer_data (&priv->converted_buffer) + buffer_available (&priv->converted_buffer),
|
||||
buffer_tailspace (&priv->converted_buffer),
|
||||
is_closing ? G_CONVERTER_INPUT_AT_END : G_CONVERTER_FLUSH,
|
||||
&bytes_read,
|
||||
|
Loading…
Reference in New Issue
Block a user