Skip to content

Commit

Permalink
make sure that there is no negative left shift (#225)
Browse files Browse the repository at this point in the history
  • Loading branch information
farindk committed Feb 23, 2021
1 parent a3f1c6a commit dbff907
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions libde265/slice.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4174,6 +4174,11 @@ void read_pcm_samples_internal(thread_context* tctx, int x0, int y0, int log2CbS

int shift = bitDepth - nPcmBits;

// a shift < 0 may result when the SPS sequence header is broken
if (shift < 0) {
shift=0;
}

for (int y=0;y<h;y++)
for (int x=0;x<w;x++)
{
Expand Down

0 comments on commit dbff907

Please sign in to comment.