summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Xv.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Xv.c b/src/Xv.c
index f9813eb..0a07d9d 100644
--- a/src/Xv.c
+++ b/src/Xv.c
@@ -918,9 +918,10 @@ XvImageFormatValues * XvListImageFormats (
}
if(rep.num_formats) {
- int size = (rep.num_formats * sizeof(XvImageFormatValues));
+ if (rep.num_formats < (INT_MAX / sizeof(XvImageFormatValues)))
+ ret = Xmalloc(rep.num_formats * sizeof(XvImageFormatValues));
- if((ret = Xmalloc(size))) {
+ if (ret != NULL) {
xvImageFormatInfo Info;
int i;