[matroska] r827 - trunk/DvdMenuXtractor/libdvdread/dvdread

[email protected]
Newsgroups gmane.comp.multimedia.matroska.cvs
Message-ID <[email protected]>
Author: robux4
Date: 2004-09-18 17:53:12 +0400 (Sat, 18 Sep 2004)
New Revision: 827

Modified:
   trunk/DvdMenuXtractor/libdvdread/dvdread/ifo_read.c
Log:
commit a possible buffer calculation pb

Modified: trunk/DvdMenuXtractor/libdvdread/dvdread/ifo_read.c
===================================================================
--- trunk/DvdMenuXtractor/libdvdread/dvdread/ifo_read.c	2004-09-18 13:48:16 UTC (rev 826)
+++ trunk/DvdMenuXtractor/libdvdread/dvdread/ifo_read.c	2004-09-18 13:53:12 UTC (rev 827)
@@ -895,6 +895,7 @@
   vts_ptt_srpt_t *vts_ptt_srpt;
   int info_length, i, j;
   uint32_t *data;
+  uint8_t *data_8;
 
   if(!ifofile)
     return 0;
@@ -987,10 +988,11 @@
     for(j = 0; j < vts_ptt_srpt->title[i].nr_of_ptts; j++) {
       /* The assert placed here because of Magic Knight Rayearth Daybreak */
       CHECK_VALUE(data[i] + sizeof(ptt_info_t) <= vts_ptt_srpt->last_byte + 1);
+	  data_8 = data;
       vts_ptt_srpt->title[i].ptt[j].pgcn 
-        = *(uint16_t*)(((char *)data) + data[i] + 4*j - VTS_PTT_SRPT_SIZE);
+        = *(uint16_t*)(&data_8[data[i] + 4*j - VTS_PTT_SRPT_SIZE]);
       vts_ptt_srpt->title[i].ptt[j].pgn 
-        = *(uint16_t*)(((char *)data) + data[i] + 4*j + 2 - VTS_PTT_SRPT_SIZE);
+        = *(uint16_t*)(&data_8[data[i] + 4*j + 2 - VTS_PTT_SRPT_SIZE]);
     }
   }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.