Permalink
Browse files

Fix Coverity 700283. This is most likely an actual bug fix.

This code was originally copied from a static function in libavcodec.
It is now updated with changes since made to the original function.
  • Loading branch information...
stichnot committed May 30, 2013
1 parent b5c1a6b commit fa2210f20be6f06b714b0eec8bdc14eb8c1915c6
Showing with 3 additions and 4 deletions.
  1. +3 −4 mythtv/libs/libmythtv/DVD/dvdringbuffer.cpp
@@ -1859,7 +1859,7 @@ int DVDRingBuffer::is_transp(const uint8_t *buf, int pitch, int n,
*/
int DVDRingBuffer::find_smallest_bounding_rectangle(AVSubtitle *s)
{
uint8_t transp_color[256];
uint8_t transp_color[256] = { 0 };
int y1, y2, x1, x2, y, w, h, i;
uint8_t *bitmap;
@@ -1869,10 +1869,9 @@ int DVDRingBuffer::find_smallest_bounding_rectangle(AVSubtitle *s)
return 0;
}
memset(transp_color, 0, 256);
for (i = 0; i < s->rects[0]->nb_colors * 4; i+=4)
for(i = 0; i < s->rects[0]->nb_colors; i++)
{
if ((s->rects[0]->pict.data[1][i] >> 24) == 0)
if ((((uint32_t*)s->rects[0]->pict.data[1])[i] >> 24) == 0)
transp_color[i] = 1;
}

0 comments on commit fa2210f

Please sign in to comment.