Skip to content

Commit

Permalink
avcodec/jpeg2000dwt: Fix 9/7 IDWT for small sizes
Browse files Browse the repository at this point in the history
Fixes Ticket4631

Signed-off-by: Michael Niedermayer <[email protected]>
  • Loading branch information
michaelni committed Jun 16, 2015
1 parent 8294ec6 commit 34121ca
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions libavcodec/jpeg2000dwt.c
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,11 @@ static void sr_1d97_float(float *p, int i0, int i1)
{
int i;

if (i1 == i0 + 1)
if (i1 <= i0 + 1) {
if (i0 == 1)
p[1] *= F_LFTG_K/2;
return;
}

extend97_float(p, i0, i1);

Expand Down Expand Up @@ -429,8 +432,11 @@ static void sr_1d97_int(int32_t *p, int i0, int i1)
{
int i;

if (i1 == i0 + 1)
if (i1 <= i0 + 1) {
if (i0 == 1)
p[1] = (p[1] * I_LFTG_K + (1<<16)) >> 17;
return;
}

extend97_int(p, i0, i1);

Expand Down

0 comments on commit 34121ca

Please sign in to comment.