avcodec/mpegvideo_enc: Fix potential overflow in RD
Fixes: CID1500285 Unintentional integer overflow
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit b6b2b01025)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
ed40d4850b
commit
cb4e45231c
1 changed files with 2 additions and 2 deletions
|
|
@ -1327,7 +1327,7 @@ static int estimate_best_b_count(MpegEncContext *s)
|
|||
goto fail;
|
||||
}
|
||||
|
||||
rd += (out_size * lambda2) >> (FF_LAMBDA_SHIFT - 3);
|
||||
rd += (out_size * (uint64_t)lambda2) >> (FF_LAMBDA_SHIFT - 3);
|
||||
}
|
||||
|
||||
/* get the delayed frames */
|
||||
|
|
@ -1336,7 +1336,7 @@ static int estimate_best_b_count(MpegEncContext *s)
|
|||
ret = out_size;
|
||||
goto fail;
|
||||
}
|
||||
rd += (out_size * lambda2) >> (FF_LAMBDA_SHIFT - 3);
|
||||
rd += (out_size * (uint64_t)lambda2) >> (FF_LAMBDA_SHIFT - 3);
|
||||
|
||||
rd += c->error[0] + c->error[1] + c->error[2];
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue