mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-03-28 12:32:17 +02:00
cmdutils: fix unclosed file on error
Fixes CID739865 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
58c2c17f1d
commit
0008e0d632
@ -1315,6 +1315,7 @@ int cmdutils_read_file(const char *filename, char **bufptr, size_t *size)
|
|||||||
fseek(f, 0, SEEK_SET);
|
fseek(f, 0, SEEK_SET);
|
||||||
if (*size == (size_t)-1) {
|
if (*size == (size_t)-1) {
|
||||||
av_log(NULL, AV_LOG_ERROR, "IO error: %s\n", strerror(errno));
|
av_log(NULL, AV_LOG_ERROR, "IO error: %s\n", strerror(errno));
|
||||||
|
fclose(f);
|
||||||
return AVERROR(errno);
|
return AVERROR(errno);
|
||||||
}
|
}
|
||||||
*bufptr = av_malloc(*size + 1);
|
*bufptr = av_malloc(*size + 1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user