[MPlayer-cvslog] r38222 - trunk/libmpdemux/demux_pva.c

reimar subversion at mplayerhq.hu
Wed Jan 20 20:03:32 EET 2021


Author: reimar
Date: Wed Jan 20 20:03:32 2021
New Revision: 38222

Log:
demux_pva.c: fix data types and use calloc.

Improves behaviour for trac issue #2359.

Modified:
   trunk/libmpdemux/demux_pva.c

Modified: trunk/libmpdemux/demux_pva.c
==============================================================================
--- trunk/libmpdemux/demux_pva.c	Wed Jan 20 20:03:31 2021	(r38221)
+++ trunk/libmpdemux/demux_pva.c	Wed Jan 20 20:03:32 2021	(r38222)
@@ -51,7 +51,7 @@
 
 typedef struct {
 	off_t offset;
-	int size;
+	uint16_t size;
 	uint8_t type;
 	uint8_t is_packet_start;
 	float pts;
@@ -62,7 +62,7 @@ typedef struct {
 	float last_audio_pts;
 	float last_video_pts;
 	float video_pts_after_prebytes;
-	int video_size_after_prebytes;
+	uint16_t video_size_after_prebytes;
 	uint8_t prebytes_delivered;
 	uint8_t just_synced;
 	uint8_t synced_stream_id;
@@ -140,13 +140,12 @@ static demuxer_t * demux_open_pva (demux
 
 
 
-	priv=malloc(sizeof(pva_priv_t));
+	priv=calloc(1, sizeof(pva_priv_t));
 
 	if(demuxer->stream->type!=STREAMTYPE_FILE) demuxer->seekable=0;
 	else demuxer->seekable=1;
 
 	demuxer->priv=priv;
-	memset(demuxer->priv,0,sizeof(pva_priv_t));
 
 	if(!pva_sync(demuxer))
 	{


More information about the MPlayer-cvslog mailing list