Permalink
Browse files

check buffer index is within range before using it (thanks to David B…

…inderman)
  • Loading branch information...
1 parent 0a67724 commit 707d1862c8d2c0b538caa5b6077e4a00a7487cec Lawrence D'Oliveiro committed Feb 19, 2014
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/mpeg2desc.c
View
@@ -673,7 +673,7 @@ static void process_packets
else
{
hdroffs = 0;
- while (buf[hdroffs] == 0xff && hdroffs < sizeof(buf))
+ while (hdroffs < sizeof(buf) && buf[hdroffs] == 0xff)
hdroffs++;
if ((buf[hdroffs] & 0xC0) == 0x40)
{

0 comments on commit 707d186

Please sign in to comment.