mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
avcodec/jpeg2000dwt: use av_malloc_array()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
7de2cea8a9
commit
1aa388d439
@ -518,17 +518,17 @@ int ff_jpeg2000_dwt_init(DWTContext *s, uint16_t border[2][2],
|
||||
}
|
||||
switch (type) {
|
||||
case FF_DWT97:
|
||||
s->f_linebuf = av_malloc((maxlen + 12) * sizeof(*s->f_linebuf));
|
||||
s->f_linebuf = av_malloc_array((maxlen + 12), sizeof(*s->f_linebuf));
|
||||
if (!s->f_linebuf)
|
||||
return AVERROR(ENOMEM);
|
||||
break;
|
||||
case FF_DWT97_INT:
|
||||
s->i_linebuf = av_malloc((maxlen + 12) * sizeof(*s->i_linebuf));
|
||||
s->i_linebuf = av_malloc_array((maxlen + 12), sizeof(*s->i_linebuf));
|
||||
if (!s->i_linebuf)
|
||||
return AVERROR(ENOMEM);
|
||||
break;
|
||||
case FF_DWT53:
|
||||
s->i_linebuf = av_malloc((maxlen + 6) * sizeof(*s->i_linebuf));
|
||||
s->i_linebuf = av_malloc_array((maxlen + 6), sizeof(*s->i_linebuf));
|
||||
if (!s->i_linebuf)
|
||||
return AVERROR(ENOMEM);
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user