Commit 9b8c8a93 authored by Luca Barbato's avatar Luca Barbato Committed by Vittorio Giovara

svq1dec: Validate the stages value strictly

It can be less than -1.

Bug-Id: CID 1194397 / CID 1194398
CC: libav-stable@libav.org
parent 6f7a3283
......@@ -191,7 +191,7 @@ static int svq1_decode_block_intra(GetBitContext *bitbuf, uint8_t *pixels,
continue; /* skip vector */
}
if (stages > 0 && level >= 4) {
if ((stages > 0 && level >= 4) || stages < 0) {
av_dlog(NULL,
"Error (svq1_decode_block_intra): invalid vector: stages=%i level=%i\n",
stages, level);
......@@ -253,7 +253,7 @@ static int svq1_decode_block_non_intra(GetBitContext *bitbuf, uint8_t *pixels,
if (stages == -1)
continue; /* skip vector */
if ((stages > 0) && (level >= 4)) {
if ((stages > 0 && level >= 4) || stages < 0) {
av_dlog(NULL,
"Error (svq1_decode_block_non_intra): invalid vector: stages=%i level=%i\n",
stages, level);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment