Subject: pkg/30677: ogmtools has bogus alginment/packing assumptions
To: None <,,>
From: Martin Husemann <>
List: pkgsrc-bugs
Date: 07/06/2005 16:59:01
>Number:         30677
>Category:       pkg
>Synopsis:       ogmtools has bogus alginment/packing assumptions
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jul 06 16:59:01 +0000 2005
>Originator:     Martin Husemann
>Release:        NetBSD 3.99.7
System: NetBSD 3.99.7 NetBSD 3.99.7 (NELLY) #12: Thu Jun 30 21:05:24 CEST 2005 sparc64
Architecture: sparc64
Machine: sparc64

On certain ogm files, the tool ogminfo from multimedia/ogmtools can not
identify streams. This happens, because the header size (as encoded in
the header) does not seem sufficient when compared to the 
sizeof(old_stream_header) - because the compiler might add alginment add
the end of the structure on somer archs. This probably is the reason that
the otherwise identical struct stream_header has grown an additional

  ogg_int16_t padding;

at the end.

In the case I looked at, this if did not hit (line 342 of ogminfo.c):

    } else if (((*pack.packet & PACKET_TYPE_BITS ) == PACKET_TYPE_HEADER) &&
               (pack.bytes >= (int)(sizeof(old_stream_header) + 1))) {

because pack.bytes was 53, but sizeof(old_stream_header) was 56.

I didn't look for other instances of this problem in the pkg, but there
likely are some:

fgrep old_stream_header * | fgrep sizeof | wc -l

Run ogminfo on strict alignement archs/code inspection.
Probably report to upstream maintainers?