[MPlayer-dev-eng] [PATCH 4/6] demux_pva.c: fix data types and use calloc.

Reimar Döffinger Reimar.Doeffinger at gmx.de
Mon Jan 18 00:00:38 EET 2021


Improves behaviour for trac issue #2359.
---
 libmpdemux/demux_pva.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/libmpdemux/demux_pva.c b/libmpdemux/demux_pva.c
index aa798c4f8..3aa9fb91e 100644
--- a/libmpdemux/demux_pva.c
+++ b/libmpdemux/demux_pva.c
@@ -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 (demuxer_t * demuxer)



-	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))
 	{
--
2.30.0



More information about the MPlayer-dev-eng mailing list