1 Reply Latest reply on Jun 12, 2014 10:13 AM by SeyhanA_31

    [Possible] minor bug in platform_write_dct()

    cogoc_1937206

      Hello,

       

      I've been perusing the DCT code to get a better feel for how it works.  (My main concern was how/if backwards compatibility would be handled if, for example, the device was upgraded to v1.2 which added new DCT data, then downgraded back to v1.1.  Looks like this will be fine.)

       

      Anyway, if I understand the code correctly, the data-length check at the beginning of platform_write_dct() isn't quite right.  It's currently:

          /* Check if the data is too big to write */
          if ( data_length + data_start_offset > ( PLATFORM_DCT_COPY1_END_ADDRESS - PLATFORM_DCT_COPY1_START_ADDRESS ) )
          {
              return -1;
          }
      

      But I think it should be:

          /* Check if the data is too big to write */
          if ( sizeof(platform_dct_header_t) + data_length + data_start_offset > ( PLATFORM_DCT_COPY1_END_ADDRESS - PLATFORM_DCT_COPY1_START_ADDRESS ) )
          {
              return -1;
          }
      

       

      More generally -- is this the place you'd like people to be submitting bug reports?

       

      Cheers!