mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-13 15:12:58 +00:00
sparsefile: ensure error is set when read_buffer() returns 0
gst_sparse_file_read() is supposed to set @error when returning 0 but in some cases was not. Hopefully fix a crash in gst_download_buffer_read_buffer() which is checking error->code when 0 is returned. I'm not totally sure when this happens as I debugged this from a post mortem crash but returning a generic error here seems the safe thing to do. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8321>
This commit is contained in:
parent
60f4cd77d5
commit
5b4eb339a3
1 changed files with 7 additions and 0 deletions
|
@ -383,7 +383,14 @@ error:
|
|||
gst_sparse_file_io_error_from_errno (errno), "Error reading file: %s",
|
||||
g_strerror (errno));
|
||||
} else if (feof (file->file)) {
|
||||
if (res == 0) {
|
||||
g_set_error_literal (error, GST_SPARSE_FILE_IO_ERROR,
|
||||
GST_SPARSE_FILE_IO_ERROR_FAILED, "Error reading file: EOF");
|
||||
}
|
||||
return res;
|
||||
} else {
|
||||
g_set_error_literal (error, GST_SPARSE_FILE_IO_ERROR,
|
||||
GST_SPARSE_FILE_IO_ERROR_FAILED, "Error reading file");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue