[MPlayer-dev-eng] [PATCH] fix a few warnings

Dominik 'Rathann' Mierzejewski dominik at rangers.eu.org
Thu Jan 25 04:57:49 CET 2007


Found this rotting in my patch queue.

One weird thing, though:

libmpdemux/demux_mov.c:
@@ -1369,7 +1369,7 @@                                                                                                   
            z_stream zstrm;
            stream_t* backup;

-           if (moov_sz > SIZE_MAX - 16) {
+           if (moov_sz > INT_MAX - 16) {
               mp_msg(MSGT_DEMUX, MSGL_ERR, "Invalid cmvd atom size %d\n", moov_sz);
               break;
             }

With SIZE_MAX, I get "condition always false" or something like that.

-- 
MPlayer developer and RPMs maintainer: http://mplayerhq.hu http://rpm.livna.org
There should be a science of discontent. People need hard times and
oppression to develop psychic muscles.
	-- from "Collected Sayings of Muad'Dib" by the Princess Irulan
-------------- next part --------------
--- MPlayer-20771/libvo/mga_common.c.warn	2006-07-03 03:05:06.000000000 +0200
+++ MPlayer-20771/libvo/mga_common.c	2006-11-08 04:22:52.000000000 +0100
@@ -2,6 +2,7 @@
 #include "fastmemcpy.h"
 #include "cpudetect.h"
 #include "libswscale/swscale.h"
+#include "libswscale/rgb2rgb.h"
 #include "libmpcodecs/vf_scale.h"
 #include "mp_msg.h"
 #include "help_mp.h"
--- MPlayer-20771/libao2/ao_polyp.c.warn	2006-07-17 18:02:25.000000000 +0200
+++ MPlayer-20771/libao2/ao_polyp.c	2006-11-08 04:22:52.000000000 +0100
@@ -246,8 +246,8 @@
 
 /** Return the current latency in seconds */
 static float get_delay(void) {
-    assert(stream && context && pa_stream_get_state(stream) == PA_STREAM_READY);
     pa_usec_t latency;
+    assert(stream && context && pa_stream_get_state(stream) == PA_STREAM_READY);
 
     /*     latency = 0; */
 /*     wait_for_operation(pa_stream_get_latency(stream, latency_func, NULL)); */
--- MPlayer-20771/stream/tcp.c.warn	2006-08-29 23:19:55.000000000 +0200
+++ MPlayer-20771/stream/tcp.c	2006-11-08 04:22:52.000000000 +0100
@@ -19,6 +19,7 @@
 
 #include "mp_msg.h"
 #include "help_mp.h"
+#include "input/input.h"
 
 #ifndef HAVE_WINSOCK2
 #include <netdb.h>
--- MPlayer-20771/stream/cache2.c.warn	2006-08-15 11:18:04.000000000 +0200
+++ MPlayer-20771/stream/cache2.c	2006-11-08 04:22:52.000000000 +0100
@@ -28,12 +28,11 @@
 #include "help_mp.h"
 
 #include "stream.h"
+#include "input/input.h"
 
 int stream_fill_buffer(stream_t *s);
 int stream_seek_long(stream_t *s,off_t pos);
 
-extern int mp_input_check_interrupt(int time);
-
 typedef struct {
   // constats:
   unsigned char *buffer;      // base pointer of the alllocated buffer memory
--- MPlayer-20771/stream/network.c.warn	2006-09-19 00:59:38.000000000 +0200
+++ MPlayer-20771/stream/network.c	2006-11-08 04:22:52.000000000 +0100
@@ -40,8 +40,6 @@
 
 extern int stream_cache_size;
 
-extern int mp_input_check_interrupt(int time);
-
 /* Variables for the command line option -user, -passwd, -bandwidth,
    -user-agent and -nocookies */
 
--- MPlayer-20771/libmpdemux/demuxer.c.warn	2006-11-08 04:20:00.000000000 +0100
+++ MPlayer-20771/libmpdemux/demuxer.c	2006-11-08 04:22:52.000000000 +0100
@@ -22,6 +22,7 @@
 
 #include "libaf/af_format.h"
 
+extern void resync_video_stream(sh_video_t *sh_video);
 extern void resync_audio_stream(sh_audio_t *sh_audio);
 
 // Demuxer list
--- MPlayer-20771/libmpdemux/muxer_mpeg.c.warn	2006-10-30 21:52:36.000000000 +0100
+++ MPlayer-20771/libmpdemux/muxer_mpeg.c	2006-11-08 04:22:52.000000000 +0100
@@ -859,7 +859,7 @@
 	}
 }
 
-static int update_demux_bufsize(muxer_headers_t *spriv, uint64_t dts, int framelen, int type)
+static void update_demux_bufsize(muxer_headers_t *spriv, uint64_t dts, int framelen, int type)
 {
 	int dim = (spriv->track_len+16)*sizeof(buffer_track_t);
 
@@ -869,7 +869,7 @@
 		if(!tmp)
 		{
 			mp_msg(MSGT_MUXER, MSGL_ERR, "\r\nERROR, couldn't realloc %d bytes for tracking buffer\r\n", dim);
-			return 0;
+			return;
 		}
 		spriv->buffer_track = tmp;
 		memset(&(spriv->buffer_track[spriv->track_pos+1]), 0, 16*sizeof(buffer_track_t));
--- MPlayer-20771/libmpdemux/demux_mov.c.warn	2006-08-15 11:18:09.000000000 +0200
+++ MPlayer-20771/libmpdemux/demux_mov.c	2006-11-08 04:22:52.000000000 +0100
@@ -1369,7 +1369,7 @@
 	    z_stream zstrm;
 	    stream_t* backup;
 
-	    if (moov_sz > SIZE_MAX - 16) {
+	    if (moov_sz > INT_MAX - 16) {
               mp_msg(MSGT_DEMUX, MSGL_ERR, "Invalid cmvd atom size %d\n", moov_sz);
               break;
             }


More information about the MPlayer-dev-eng mailing list