forked from FFmpeg/FFmpeg
av_lzo1x_decode: properly handle negative buffer length.
Treating them like 0 is safest, current code would invoke undefined pointer arithmetic behaviour in this case. Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
This commit is contained in:
parent
7f6c828f2e
commit
b9242fd12f
1 changed files with 3 additions and 3 deletions
|
@ -175,11 +175,11 @@ int av_lzo1x_decode(void *out, int *outlen, const void *in, int *inlen) {
|
||||||
int state= 0;
|
int state= 0;
|
||||||
int x;
|
int x;
|
||||||
LZOContext c;
|
LZOContext c;
|
||||||
if (!*outlen || !*inlen) {
|
if (*outlen <= 0 || *inlen <= 0) {
|
||||||
int res = 0;
|
int res = 0;
|
||||||
if (!*outlen)
|
if (*outlen <= 0)
|
||||||
res |= AV_LZO_OUTPUT_FULL;
|
res |= AV_LZO_OUTPUT_FULL;
|
||||||
if (!*inlen)
|
if (*inlen <= 0)
|
||||||
res |= AV_LZO_INPUT_DEPLETED;
|
res |= AV_LZO_INPUT_DEPLETED;
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue