1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110
|
Description: Fix out-of-bounds indexing problems and get rid of warnings on
AMD64 (closes: #318269) and fix buffer overflow via command-line
argument (Closes: #368207)
Author: Gabor Gombas <gombasg@sztaki.hu>
Author: Alec Berryman <alec@thened.net>
Last-Update: 2006-08-13
Index: mp3info/Makefile
===================================================================
--- mp3info.orig/Makefile
+++ mp3info/Makefile
@@ -28,9 +28,9 @@
# bindir = where binaries get installed (default = /usr/local/bin)
# mandir = where the manual page gets installed (default = /usr/local/man/man1)
-prefix=/usr/local
+prefix=$(DESTDIR)/usr
bindir=${prefix}/bin
-mandir = $(prefix)/man/man1
+mandir = $(prefix)/share/man/man1
# No changes necessary below this line
@@ -69,12 +69,10 @@ distclean: clean
$(RM) -f mp3info.txt
install-mp3info: mp3info
- $(STRIP) mp3info
$(INSTALL) mp3info $(bindir)/mp3info
$(INSTALL) mp3info.1 $(mandir)/mp3info.1
install-gmp3info: gmp3info
- $(STRIP) gmp3info
$(INSTALL) gmp3info $(bindir)/gmp3info
install: install-mp3info install-gmp3info
Index: mp3info/mp3info.1
===================================================================
--- mp3info.orig/mp3info.1
+++ mp3info/mp3info.1
@@ -170,10 +170,10 @@ Number of corrupt audio frames [integer]
Sampling frequency in Hz [integer]
.B
.IP %q
-Sampling frequency in KHz [integer]
+Sampling frequency in kHz [integer]
.B
.IP %r
-Bit Rate in KB/s (type and meaning affected by \fB-r\fP option)
+Bit Rate in kbps (type and meaning affected by \fB-r\fP option)
.B
.IP %m
Playing time: minutes only [integer]
Index: mp3info/mp3info.c
===================================================================
--- mp3info.orig/mp3info.c
+++ mp3info/mp3info.c
@@ -34,7 +34,7 @@
char FILENAME_FORMAT_STRING[]="File: %F\n";
char ID3_FORMAT_STRING[]="Title: %-30t Track: %n\nArtist: %a\nAlbum: %-30l Year: %y\nComment: %-30c Genre: %g [%G]\n";
-char TECH_FORMAT_STRING[]="Media Type: MPEG %2.1v Layer %L\nAudio: %r KB/s, %qKHz (%o)\nEmphasis: %e\nCRC: %E\nCopyright: %C\nOriginal: %O\nPadding: %p\nLength: %m:%02s\n";
+char TECH_FORMAT_STRING[]="Media Type: MPEG %2.1v Layer %L\nAudio: %r kbps, %q kHz (%o)\nEmphasis: %e\nCRC: %E\nCopyright: %C\nOriginal: %O\nPadding: %p\nLength: %m:%02s\n";
int main(int argc, char *argv[]) {
FILE *fp;
@@ -183,7 +183,7 @@ int main(int argc, char *argv[]) {
file_open=0;
if (view_only == 1) {
if ( !( fp=fopen(argv[i],"rb") ) ) {
- sprintf(error_msg,"Error opening MP3: %s",argv[i]);
+ snprintf(error_msg,sizeof(error_msg),"Error opening MP3: %s",argv[i]);
perror(error_msg);
retcode |= 1;
} else {
@@ -191,7 +191,7 @@ int main(int argc, char *argv[]) {
}
} else {
if ( !( fp=fopen(argv[i],"rb+") ) ) {
- sprintf(error_msg,"Error opening MP3: %s",argv[i]);
+ snprintf(error_msg,sizeof(error_msg),"Error opening MP3: %s",argv[i]);
perror(error_msg);
retcode |= 1;
} else {
@@ -211,8 +211,10 @@ int main(int argc, char *argv[]) {
}
if(view_only) {
- if(want_id3 && !mp3.id3_isvalid)
+ if(want_id3 && !mp3.id3_isvalid) {
fprintf(stderr,"%s does not have an ID3 1.x tag.\n",mp3.filename);
+ retcode |= 16;
+ }
if(print_format) {
format_output(print_format,&mp3,vbr_report);
Index: mp3info/textfunc.c
===================================================================
--- mp3info.orig/textfunc.c
+++ mp3info/textfunc.c
@@ -105,8 +105,8 @@ void display_help() {
"\n\t\t%%u\tNumber of good audio frames (integer)\n"\
"\t\t%%b\tNumber of corrupt audio frames (integer)\n"\
"\t\t%%Q\tSampling frequency in Hz (integer)\n"\
- "\t\t%%q\tSampling frequency in KHz (integer)\n"\
- "\t\t%%r\tBit Rate in KB/s (see also '-r')\n"\
+ "\t\t%%q\tSampling frequency in kHz (integer)\n"\
+ "\t\t%%r\tBit Rate in kbps (see also '-r')\n"\
"\n\t\t%%m\tPlaying time: minutes only (integer)\n"\
"\t\t%%s\tPlaying time: seconds only (integer)\n"\
"\t\t%%S\tTotal playing time in seconds (integer)\n"\
|