Skip to content
Snippets Groups Projects
Commit f1d4ade9 authored by Alaric Senat's avatar Alaric Senat Committed by Jean-Baptiste Kempf
Browse files

medialibrary: thumb: check fclose while saving


It should not be assumed that the thumbnail was saved properly when
`fclose` fails.

The RAII wrapper here does not improve readability or shorten the code.
Removing it also works around a GCC `-Wignored-attributes` warning that
was triggered due to `fclose` being tagged as `__nonnull((1))`:

```text
modules/misc/medialibrary/MetadataExtractor.cpp: In member function ‘virtual bool EmbeddedThumbnail::save(const std::string&)’:
modules/misc/medialibrary/MetadataExtractor.cpp:44:44: warning: ignoring attributes on template argument ‘int (*)(FILE*)’ [-Wignored-attributes]
   44 |     std::unique_ptr<FILE, decltype(&fclose)> f{ vlc_fopen( path.c_str(), "wb" ),
      |                                            ^
```

Co-authored-by: Alexandre Janniaux's avatarAlexandre Janniaux <ajanni@videolabs.io>
parent e38b161b
No related branches found
No related tags found
1 merge request!4059medialibrary: thumb: check fclose while saving
Pipeline #372242 passed with stage
in 20 minutes and 25 seconds
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment