fix a few more obvious coredumps and bad dereferences.

This commit is contained in:
espie 2005-09-04 23:51:51 +00:00
parent f414672364
commit 6906deb604
4 changed files with 107 additions and 11 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.89 2005/08/29 06:53:54 biorn Exp $
# $OpenBSD: Makefile,v 1.90 2005/09/04 23:51:51 espie Exp $
# May not be hard to add more.
ONLY_FOR_ARCHS= amd64 i386 powerpc sparc64 arm
@ -7,7 +7,7 @@ COMMENT= "Movie player supporting MPEG, DivX, AVI, ASF, MOV & more"
DISTNAME= MPlayer-1.0pre7
DIST_SUBDIR= mplayer
PKGNAME= ${DISTNAME:L}p5
PKGNAME= ${DISTNAME:L}p6
CATEGORIES= x11
EXTRACT_SUFX= .tar.bz2

View File

@ -1,7 +1,17 @@
$OpenBSD: patch-libaf_af_c,v 1.1 2005/08/27 21:11:49 espie Exp $
$OpenBSD: patch-libaf_af_c,v 1.2 2005/09/04 23:51:52 espie Exp $
--- libaf/af.c.orig Sat Aug 27 13:31:21 2005
+++ libaf/af.c Sat Aug 27 13:39:50 2005
@@ -378,7 +378,7 @@ int af_init(af_stream_t* s, int force_ou
+++ libaf/af.c Sun Sep 4 00:17:07 2005
@@ -370,7 +370,8 @@ int af_init(af_stream_t* s, int force_ou
// If force_output isn't set do not compensate for output format
if(!force_output){
- memcpy(&s->output, s->last->data, sizeof(af_data_t));
+ if (s->last)
+ memcpy(&s->output, s->last->data, sizeof(af_data_t));
return 0;
}
@@ -378,7 +379,7 @@ int af_init(af_stream_t* s, int force_ou
if((AF_INIT_TYPE_MASK & s->cfg.force) != AF_INIT_FORCE){
af_instance_t* af = NULL; // New filter
// Check output frequency if not OK fix with resample
@ -10,7 +20,7 @@ $OpenBSD: patch-libaf_af_c,v 1.1 2005/08/27 21:11:49 espie Exp $
// try to find a filter that can change samplrate
af = af_control_any_rev(s, AF_CONTROL_RESAMPLE_RATE | AF_CONTROL_SET,
&(s->output.rate));
@@ -395,7 +395,7 @@ int af_init(af_stream_t* s, int force_ou
@@ -395,7 +396,7 @@ int af_init(af_stream_t* s, int force_ou
af = af_prepend(s,s->first,resampler);
}
else{
@ -19,7 +29,7 @@ $OpenBSD: patch-libaf_af_c,v 1.1 2005/08/27 21:11:49 espie Exp $
af = af_prepend(s,s->last,resampler);
else
af = af_append(s,s->last,resampler);
@@ -423,8 +423,8 @@ int af_init(af_stream_t* s, int force_ou
@@ -423,8 +424,8 @@ int af_init(af_stream_t* s, int force_ou
// Check number of output channels fix if not OK
// If needed always inserted last -> easy to screw up other filters
@ -30,3 +40,14 @@ $OpenBSD: patch-libaf_af_c,v 1.1 2005/08/27 21:11:49 espie Exp $
af = af_prepend(s,s->last,"channels");
else
af = af_append(s,s->last,"channels");
@@ -436,8 +437,8 @@ int af_init(af_stream_t* s, int force_ou
}
// Check output format fix if not OK
- if(s->last->data->format != s->output.format){
- if(strcmp(s->last->info->name,"format"))
+ if(!s->last || s->last->data->format != s->output.format){
+ if(!s->last || strcmp(s->last->info->name,"format"))
af = af_append(s,s->last,"format");
else
af = s->last;

View File

@ -0,0 +1,28 @@
$OpenBSD: patch-libmpdemux_demuxer_c,v 1.2 2005/09/04 23:51:52 espie Exp $
--- libmpdemux/demuxer.c.orig Sat Sep 3 14:28:45 2005
+++ libmpdemux/demuxer.c Sat Sep 3 14:40:33 2005
@@ -1350,7 +1350,12 @@ switch(file_format){
case DEMUXER_TYPE_MPEG_TY:
case DEMUXER_TYPE_MPEG_PS: {
- sh_video=d_video->sh;sh_video->ds=d_video;
+ if (d_video)
+ sh_video=d_video->sh;
+ else
+ sh_video = NULL;
+ if (sh_video)
+ sh_video->ds=d_video;
// if(demuxer->stream->type!=STREAMTYPE_VCD) demuxer->movi_start=0; // for VCD
if(audio_id!=-2) {
@@ -1404,8 +1409,8 @@ pts_from_bps=0; // !!!
if ((sh_video=demuxer->video->sh) && sh_video->bih)
mp_msg(MSGT_DEMUX,MSGL_INFO,"VIDEO: [%.4s] %ldx%ld %dbpp %5.3f fps %5.1f kbps (%4.1f kbyte/s)\n",
(char *)&sh_video->bih->biCompression,
- sh_video->bih->biWidth,
- sh_video->bih->biHeight,
+ (long) sh_video->bih->biWidth,
+ (long) sh_video->bih->biHeight,
sh_video->bih->biBitCount,
sh_video->fps,
sh_video->i_bps*0.008f,

View File

@ -1,7 +1,15 @@
$OpenBSD: patch-mplayer_c,v 1.2 2005/05/09 12:24:38 biorn Exp $
$OpenBSD: patch-mplayer_c,v 1.3 2005/09/04 23:51:52 espie Exp $
--- mplayer.c.orig Fri Apr 15 14:14:24 2005
+++ mplayer.c Wed Apr 20 06:35:55 2005
@@ -584,7 +584,7 @@ static void exit_sighandler(int x){
+++ mplayer.c Sat Sep 3 14:36:01 2005
@@ -184,6 +184,7 @@ static int max_framesize=0;
#include "libmpcodecs/dec_video.h"
#include "libmpcodecs/mp_image.h"
#include "libmpcodecs/vf.h"
+#include "libmpcodecs/vd.h"
extern void vf_list_plugins();
@@ -584,7 +585,7 @@ static void exit_sighandler(int x){
gdb_pid = fork();
mp_msg(MSGT_CPLAYER, MSGL_INFO, "Forked...\n");
if (gdb_pid == 0) { // We are the child
@ -10,7 +18,46 @@ $OpenBSD: patch-mplayer_c,v 1.2 2005/05/09 12:24:38 biorn Exp $
mp_msg(MSGT_CPLAYER, MSGL_ERR, "Couldn't start gdb\n");
} else if (gdb_pid < 0)
mp_msg(MSGT_CPLAYER, MSGL_ERR, "Couldn't fork\n");
@@ -3500,7 +3500,7 @@ if (stream->type==STREAMTYPE_DVDNAV && d
@@ -986,13 +987,13 @@ static void log_sub(){
if (!f) return;
fprintf(f, "----------------------------------------------------------\n");
if (subdata->sub_uses_time) {
- fprintf(f, "N: %s S: %02d:%02d:%02d.%02d E: %02d:%02d:%02d.%02d\n", filename,
+ fprintf(f, "N: %s S: %02lu:%02lu:%02lu.%02lu E: %02lu:%02lu:%02lu.%02lu\n", filename,
vo_sub_last->start/360000, (vo_sub_last->start/6000)%60,
(vo_sub_last->start/100)%60, vo_sub_last->start%100,
vo_sub_last->end/360000, (vo_sub_last->end/6000)%60,
(vo_sub_last->end/100)%60, vo_sub_last->end%100);
} else {
- fprintf(f, "N: %s S: %d E: %d\n", filename, vo_sub_last->start, vo_sub_last->end);
+ fprintf(f, "N: %s S: %lu E: %lu\n", filename, vo_sub_last->start, vo_sub_last->end);
}
for (i = 0; i < vo_sub_last->lines; i++) {
fprintf(f, "%s\n", vo_sub_last->text[i]);
@@ -3368,7 +3369,7 @@ if (stream->type==STREAMTYPE_DVDNAV && d
{
#ifdef USE_SUB
if (sh_video) {
- mp_msg(MSGT_GLOBAL,MSGL_INFO,MSGTR_AnsSubVisibility, sub_visibility);
+ mp_msg(MSGT_GLOBAL,MSGL_INFO,MSGTR_AnsSubVisibility, (long)sub_visibility);
}
#endif
} break;
@@ -3488,11 +3489,11 @@ if (stream->type==STREAMTYPE_DVDNAV && d
case MP_CMD_GET_VO_FULLSCREEN : {
if(video_out && vo_config_count)
- mp_msg(MSGT_GLOBAL,MSGL_INFO,MSGTR_AnsVoFullscreen, vo_fs);
+ mp_msg(MSGT_GLOBAL,MSGL_INFO,MSGTR_AnsVoFullscreen, (long)vo_fs);
} break;
case MP_CMD_GET_PERCENT_POS : {
- mp_msg(MSGT_GLOBAL,MSGL_INFO,MSGTR_AnsPercentPos, demuxer_get_percent_pos(demuxer));
+ mp_msg(MSGT_GLOBAL,MSGL_INFO,MSGTR_AnsPercentPos, (long)demuxer_get_percent_pos(demuxer));
} break;
case MP_CMD_SWITCH_AUDIO :
demuxer_switch_audio(demuxer);
@@ -3500,7 +3501,7 @@ if (stream->type==STREAMTYPE_DVDNAV && d
case MP_CMD_RUN : {
#ifndef __MINGW32__
if(!fork()) {