Review Request 130165: Workaround fix Audio CD shows the wrong number of tracks for different tocs

Leslie Zhai lesliezhai at llvm.org.cn
Mon Jun 26 03:17:55 BST 2017



> On 六月 26, 2017, 6:14 a.m., Albert Astals Cid wrote:
> > audiocd.cpp, line 129
> > <https://git.reviewboard.kde.org/r/130165/diff/2/?file=496698#file496698line129>
> >
> >     Yes, not really different, the drives has the exact number of tracks, with each of the tracks starting in the same sector, having the same flags and same bTrack, so why do you think the would be different?

Static analysis might say: but what if the exact number of tracks is 101 :)

```
https://svn.xiph.org/trunk/cdparanoia/interface/cdda_interface.h

#define MAXTRK 100

typedef struct TOC {	/* structure of table of contents */
  unsigned char bFlags;
  unsigned char bTrack;
  int32_t dwStartSector;
} TOC;
```

then TOC disc_toc[MAXTRK] might be stack buffer overflow when disc_toc[100], but what is the possibility of the exact number of track is 101? just like what I concern about NULL pointer dereference(https://reviews.llvm.org/D31868) issue in real project (https://github.com/OpenSCAP/openscap/pull/758)


- Leslie


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/130165/#review103367
-----------------------------------------------------------


On 六月 26, 2017, 10:07 a.m., Leslie Zhai wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/130165/
> -----------------------------------------------------------
> 
> (Updated 六月 26, 2017, 10:07 a.m.)
> 
> 
> Review request for KDE Multimedia, Albert Astals Cid, Anthony Fieroni, Harald Sitter, and Xuetian Weng.
> 
> 
> Bugs: 381038
>     http://bugs.kde.org/show_bug.cgi?id=381038
> 
> 
> Repository: audiocd-kio
> 
> 
> Description
> -------
> 
> Dear,
> 
> As pietz described in the bugzilla, audiocd kio slave failed to refresh template titles, so dolphin shows still the number of files from the first CD in the drive, not update the template titles.
> 
> I do not have different CDs right now in my office, but I will borrow some "Music Together" CDs from my little kid :) but I directly read the source code for debugging, although workaround patch is let `tocsAreDifferent` always return true to refresh in force, but what the root cause is? please give me some hints, thanks a lot!
> 
> Regards,
> Leslie Zhai
> 
> 
> Diffs
> -----
> 
>   audiocd.cpp 926308d 
> 
> Diff: https://git.reviewboard.kde.org/r/130165/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Leslie Zhai
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-multimedia/attachments/20170626/4ac79dbe/attachment.htm>


More information about the kde-multimedia mailing list