openbsd-ports/x11/mplayer/patches/patch-libmpdemux_asfheader_c

24 lines
967 B
Plaintext

$OpenBSD: patch-libmpdemux_asfheader_c,v 1.1 2006/04/06 21:47:43 biorn Exp $
--- libmpdemux/asfheader.c.orig Sat Dec 25 12:31:32 2004
+++ libmpdemux/asfheader.c Thu Apr 6 20:30:42 2006
@@ -189,7 +189,7 @@ int read_asf_header(demuxer_t *demuxer){
while ((pos = find_asf_guid(hdr, asf_stream_header_guid, pos, hdr_len)) >= 0)
{
ASF_stream_header_t *streamh = (ASF_stream_header_t *)&hdr[pos];
- char *buffer;
+ uint8_t *buffer;
pos += sizeof(ASF_stream_header_t);
if (pos > hdr_len) goto len_err_out;
le2me_ASF_stream_header_t(streamh);
@@ -222,7 +222,9 @@ int read_asf_header(demuxer_t *demuxer){
asf_scrambling_h=buffer[0];
asf_scrambling_w=(buffer[2]<<8)|buffer[1];
asf_scrambling_b=(buffer[4]<<8)|buffer[3];
- asf_scrambling_w/=asf_scrambling_b;
+ if(asf_scrambling_b>0){
+ asf_scrambling_w/=asf_scrambling_b;
+ }
} else {
asf_scrambling_b=asf_scrambling_h=asf_scrambling_w=1;
}