summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/demuxers/demux_aiff.c2
-rw-r--r--src/demuxers/demux_ogg.c9
-rw-r--r--src/demuxers/demux_qt.c13
-rw-r--r--src/demuxers/demux_real.c2
-rw-r--r--src/demuxers/demux_ts.c13
-rw-r--r--src/demuxers/demux_tta.c2
6 files changed, 25 insertions, 16 deletions
diff --git a/src/demuxers/demux_aiff.c b/src/demuxers/demux_aiff.c
index ee45963a5..0b4f5c513 100644
--- a/src/demuxers/demux_aiff.c
+++ b/src/demuxers/demux_aiff.c
@@ -94,7 +94,7 @@ static int extended_to_int(const unsigned char p[10])
m = (m<<8) + p[2+i];;
e = (((int)p[0]&0x7f)<<8) | p[1];
if (e == 0x7fff && m)
- return 0.0/0.0;
+ return (int)(0.0/0.0);
e -= 16383 + 63;
if (p[0]&0x80)
diff --git a/src/demuxers/demux_ogg.c b/src/demuxers/demux_ogg.c
index 573baa593..e0abd0cd6 100644
--- a/src/demuxers/demux_ogg.c
+++ b/src/demuxers/demux_ogg.c
@@ -446,6 +446,7 @@ static const struct ogg_meta {
OGG_META (COMMENT, 0),
};
+#if 0
/* ensure that those marked "append" are cleared */
/* FIXME: is this useful? Should they be cleared on first write? */
static void prepare_read_comments (demux_ogg_t *this)
@@ -458,6 +459,7 @@ static void prepare_read_comments (demux_ogg_t *this)
this->meta[metadata[i].meta] = NULL;
}
}
+#endif
static int read_comments (demux_ogg_t *this, const char *comment)
{
@@ -468,9 +470,10 @@ static int read_comments (demux_ogg_t *this, const char *comment)
if (!strncasecmp (metadata[i].tag, comment, ml) && comment[ml]) {
if (metadata[i].append && this->meta[metadata[i].meta]) {
char *newstr;
- asprintf (&newstr, "%s\n%s", this->meta[metadata[i].meta], comment + ml);
- free (this->meta[metadata[i].meta]);
- this->meta[metadata[i].meta] = newstr;
+ if (asprintf (&newstr, "%s\n%s", this->meta[metadata[i].meta], comment + ml) >= 0) {
+ free (this->meta[metadata[i].meta]);
+ this->meta[metadata[i].meta] = newstr;
+ }
}
else {
free (this->meta[metadata[i].meta]);
diff --git a/src/demuxers/demux_qt.c b/src/demuxers/demux_qt.c
index 7c6f7efe3..d0fa3fd77 100644
--- a/src/demuxers/demux_qt.c
+++ b/src/demuxers/demux_qt.c
@@ -710,9 +710,11 @@ static char *qtl_file_url (input_plugin_t *input, const unsigned char *preview,
{ /* relative */
const char *dir = input->get_mrl (input);
slash = strrchr (dir, '/');
- asprintf (&url, "%.*s/%s",
- slash ? (int)(slash - dir) : 1,
- slash ? dir : ".", url);
+ if (asprintf (&url, "%.*s/%s",
+ slash ? (int)(slash - dir) : 1,
+ slash ? dir : ".", url) < 0) {
+ url = NULL;
+ }
}
}
@@ -1802,11 +1804,12 @@ static void get_next_edit_list_entry(qt_trak *trak,
int64_t *edit_list_duration,
unsigned int global_timescale) {
+ *edit_list_media_time = 0;
+ *edit_list_duration = MAX_DURATION;
+
/* if there is no edit list, set to max duration and get out */
if (!trak->edit_list_table) {
- *edit_list_media_time = 0;
- *edit_list_duration = MAX_DURATION;
debug_edit_list(" qt: no edit list table, initial = %d, %"PRId64"\n", *edit_list_media_time, *edit_list_duration);
return;
diff --git a/src/demuxers/demux_real.c b/src/demuxers/demux_real.c
index 340083221..19b7794ef 100644
--- a/src/demuxers/demux_real.c
+++ b/src/demuxers/demux_real.c
@@ -303,7 +303,7 @@ static mdpr_t *real_parse_mdpr(const char *data, const unsigned int size)
mdpr->mime_type[(int)mdpr->mime_type_size]=0;
mdpr->type_specific_len=_X_BE_32(&data[34+mdpr->stream_name_size+mdpr->mime_type_size]);
- if (size < 38 + mdpr->stream_name_size + mdpr->mime_type_size + mdpr->type_specific_data)
+ if (size < 38 + mdpr->stream_name_size + mdpr->mime_type_size + mdpr->type_specific_len)
goto fail;
mdpr->type_specific_data=malloc(mdpr->type_specific_len);
if (!mdpr->type_specific_data)
diff --git a/src/demuxers/demux_ts.c b/src/demuxers/demux_ts.c
index c606d52a8..491942adc 100644
--- a/src/demuxers/demux_ts.c
+++ b/src/demuxers/demux_ts.c
@@ -329,6 +329,7 @@ typedef struct {
* and audio PIDs, we keep the index of the corresponding entry
* inthe media[] array.
*/
+ unsigned int pcr_pid;
unsigned int videoPid;
unsigned int videoMedia;
@@ -666,6 +667,7 @@ static void demux_ts_parse_pat (demux_ts_t*this, unsigned char *original_pkt,
this->last_pmt_crc = 0;
this->videoPid = INVALID_PID;
this->spu_pid = INVALID_PID;
+ this->pcr_pid = INVALID_PID;
if (this->pmt[program_count] != NULL) {
free(this->pmt[program_count]);
@@ -1581,23 +1583,21 @@ printf("Program Number is %i, looking for %i\n",program_number,this->program_num
section_length -= coded_length;
}
-#if 0
/*
* Get the current PCR PID.
*/
pid = ((this->pmt[program_count][8] << 8)
| this->pmt[program_count][9]) & 0x1fff;
- if (this->pcrPid != pid) {
+ if (this->pcr_pid != pid) {
#ifdef TS_PMT_LOG
- if (this->pcrPid == INVALID_PID) {
+ if (this->pcr_pid == INVALID_PID) {
printf ("demux_ts: PMT pcr pid 0x%.4x\n", pid);
} else {
printf ("demux_ts: PMT pcr pid changed 0x%.4x\n", pid);
}
#endif
- this->pcrPid = pid;
+ this->pcr_pid = pid;
}
-#endif
if ( this->stream->spu_channel>=0 && this->spu_langs_count>0 )
demux_ts_update_spu_channel( this );
@@ -2045,6 +2045,7 @@ static void demux_ts_event_handler (demux_ts_t *this) {
case XINE_EVENT_PIDS_CHANGE:
this->videoPid = INVALID_PID;
+ this->pcr_pid = INVALID_PID;
this->audio_tracks_count = 0;
this->media_num = 0;
this->send_newpts = 1;
@@ -2125,6 +2126,7 @@ static void demux_ts_send_headers (demux_plugin_t *this_gen) {
*/
this->videoPid = INVALID_PID;
+ this->pcr_pid = INVALID_PID;
this->audio_tracks_count = 0;
this->media_num= 0;
this->last_pmt_crc = 0;
@@ -2383,6 +2385,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen,
this->scrambled_npids = 0;
this->videoPid = INVALID_PID;
+ this->pcr_pid = INVALID_PID;
this->audio_tracks_count = 0;
this->last_pmt_crc = 0;
diff --git a/src/demuxers/demux_tta.c b/src/demuxers/demux_tta.c
index 57d2c8357..cf3745211 100644
--- a/src/demuxers/demux_tta.c
+++ b/src/demuxers/demux_tta.c
@@ -100,7 +100,7 @@ static int open_tta_file(demux_tta_t *this) {
}
this->seektable = calloc(this->totalframes, sizeof(uint32_t));
- this->input->read(this->input, this->seektable, sizeof(uint32_t)*this->totalframes);
+ this->input->read(this->input, (uint8_t*)this->seektable, sizeof(uint32_t)*this->totalframes);
/* Skip the CRC32 */
this->input->seek(this->input, 4, SEEK_CUR);