On Wed, Nov 5, 2014 at 11:01 AM, Luca Barbato <[email protected]> wrote: > On 05/11/14 16:29, Vittorio Giovara wrote: >> >> Add a comment to explain the code. >> >> CC: [email protected] >> Bug-Id: CID 1194388 >> --- >> New version, after a visit at the oracles shrine. >> Vittorio >> >> libavcodec/mjpegdec.c | 4 +++- >> 1 file changed, 3 insertions(+), 1 deletion(-) >> >> diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c >> index d9a73d8..01e11be 100644 >> --- a/libavcodec/mjpegdec.c >> +++ b/libavcodec/mjpegdec.c >> @@ -964,7 +964,9 @@ static int >> mjpeg_decode_scan_progressive_ac(MJpegDecodeContext *s, int ss, >> init_get_bits(&mb_bitmask_gb, mb_bitmask, s->mb_width * >> s->mb_height); >> >> if (!Al) { >> - s->coefs_finished[c] |= (1LL << (se + 1)) - (1LL << ss); >> + // s->coefs_finished is a bitmask for coefficients coded >> + // ss and se are parameters telling start and end coefficients >> + s->coefs_finished[c] |= (~0ULL >> (63 - (se - ss))) << ss; >> last_scan = !~s->coefs_finished[c]; >> } > > > Do we check that se - ss is positive? If yes fine for me.
We check "se < ss" and return immediately if so. That should cover that case, right? -- Vittorio _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
