mirror of
https://github.com/claunia/flac.git
synced 2025-12-16 18:54:26 +00:00
Coverity fixes
Signed-off-by: Felipe Contreras <felipe.contreras@nokia.com>
This commit is contained in:
committed by
David Schleef
parent
c2593cc1bd
commit
6c8d740c1a
@@ -287,8 +287,10 @@ FLAC__StreamMetadata *grabbag__picture_parse_specification(const char *spec, con
|
||||
|
||||
*error_message = 0;
|
||||
|
||||
if(0 == (obj = FLAC__metadata_object_new(FLAC__METADATA_TYPE_PICTURE)))
|
||||
if(0 == (obj = FLAC__metadata_object_new(FLAC__METADATA_TYPE_PICTURE))) {
|
||||
*error_message = error_messages[0];
|
||||
return obj;
|
||||
}
|
||||
|
||||
if(strchr(spec, '|')) { /* full format */
|
||||
const char *p;
|
||||
@@ -363,8 +365,10 @@ FLAC__StreamMetadata *grabbag__picture_parse_specification(const char *spec, con
|
||||
*error_message = error_messages[0];
|
||||
else {
|
||||
FILE *f = fopen(spec, "rb");
|
||||
if(0 == f)
|
||||
if(0 == f) {
|
||||
*error_message = error_messages[5];
|
||||
free(buffer);
|
||||
}
|
||||
else {
|
||||
if(fread(buffer, 1, size, f) != (size_t)size)
|
||||
*error_message = error_messages[6];
|
||||
@@ -379,6 +383,9 @@ FLAC__StreamMetadata *grabbag__picture_parse_specification(const char *spec, con
|
||||
else if((obj->data.picture.width == 0 || obj->data.picture.height == 0 || obj->data.picture.depth == 0) && !local__extract_resolution_color_info_(&obj->data.picture))
|
||||
*error_message = error_messages[4];
|
||||
}
|
||||
else {
|
||||
free(buffer);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -505,8 +505,10 @@ static const char *store_to_file_post_(const char *filename, FLAC__Metadata_Chai
|
||||
|
||||
FLAC__metadata_chain_sort_padding(chain);
|
||||
if(!FLAC__metadata_chain_write(chain, /*use_padding=*/true, preserve_modtime)) {
|
||||
const char *error;
|
||||
error = FLAC__Metadata_ChainStatusString[FLAC__metadata_chain_status(chain)];
|
||||
FLAC__metadata_chain_delete(chain);
|
||||
return FLAC__Metadata_ChainStatusString[FLAC__metadata_chain_status(chain)];
|
||||
return error;
|
||||
}
|
||||
|
||||
FLAC__metadata_chain_delete(chain);
|
||||
|
||||
Reference in New Issue
Block a user