patch from Honza Horak using Coverity's static analysis tool.

This commit is contained in:
rocky
2011-05-30 15:19:22 -04:00
parent 9be0980337
commit 940b7cd848
20 changed files with 52 additions and 28 deletions

View File

@@ -621,18 +621,18 @@ parse_tocfile (_img_private_t *cd, const char *psz_cue_name)
goto format_error;
}
} else if (0 == strcmp ("COPY", psz_keyword)) {
if (NULL != cd)
if (NULL != cd && i >= 0)
cd->tocent[i].flags |= CDIO_TRACK_FLAG_COPY_PERMITTED;
} else if (0 == strcmp ("PRE_EMPHASIS", psz_keyword)) {
if (NULL != cd)
if (NULL != cd && i >= 0)
cd->tocent[i].flags |= CDIO_TRACK_FLAG_PRE_EMPHASIS;
/* TWO_CHANNEL_AUDIO */
} else if (0 == strcmp ("TWO_CHANNEL_AUDIO", psz_keyword)) {
if (NULL != cd)
if (NULL != cd && i >= 0)
cd->tocent[i].flags &= ~CDIO_TRACK_FLAG_FOUR_CHANNEL_AUDIO;
/* FOUR_CHANNEL_AUDIO */
} else if (0 == strcmp ("FOUR_CHANNEL_AUDIO", psz_keyword)) {
if (NULL != cd)
if (NULL != cd && i >= 0)
cd->tocent[i].flags |= CDIO_TRACK_FLAG_FOUR_CHANNEL_AUDIO;
/* ISRC "CCOOOYYSSSSS" */

View File

@@ -182,6 +182,7 @@ parse_nrg (_img_private_t *p_env, const char *psz_nrg_name,
long unsigned int footer_start;
long unsigned int size;
char *footer_buf = NULL;
if (!p_env) return false;
size = cdio_stream_stat (p_env->gen.data_source);
if (-1 == size) return false;