mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-08 13:22:53 +02:00
avcodec/jpeg2000: Use av_image_check_size() in ff_jpeg2000_init_component()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 016fd413f9
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
b3bc05290a
commit
9a9dda615b
@ -28,6 +28,7 @@
|
|||||||
#include "libavutil/attributes.h"
|
#include "libavutil/attributes.h"
|
||||||
#include "libavutil/avassert.h"
|
#include "libavutil/avassert.h"
|
||||||
#include "libavutil/common.h"
|
#include "libavutil/common.h"
|
||||||
|
#include "libavutil/imgutils.h"
|
||||||
#include "libavutil/mem.h"
|
#include "libavutil/mem.h"
|
||||||
#include "avcodec.h"
|
#include "avcodec.h"
|
||||||
#include "jpeg2000.h"
|
#include "jpeg2000.h"
|
||||||
@ -210,7 +211,10 @@ int ff_jpeg2000_init_component(Jpeg2000Component *comp,
|
|||||||
codsty->nreslevels2decode - 1,
|
codsty->nreslevels2decode - 1,
|
||||||
codsty->transform))
|
codsty->transform))
|
||||||
return ret;
|
return ret;
|
||||||
// component size comp->coord is uint16_t so ir cannot overflow
|
|
||||||
|
if (av_image_check_size(comp->coord[0][1] - comp->coord[0][0],
|
||||||
|
comp->coord[1][1] - comp->coord[1][0], 0, avctx))
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
csize = (comp->coord[0][1] - comp->coord[0][0]) *
|
csize = (comp->coord[0][1] - comp->coord[0][0]) *
|
||||||
(comp->coord[1][1] - comp->coord[1][0]);
|
(comp->coord[1][1] - comp->coord[1][0]);
|
||||||
if (comp->coord[0][1] - comp->coord[0][0] > 32768 ||
|
if (comp->coord[0][1] - comp->coord[0][0] > 32768 ||
|
||||||
|
Loading…
Reference in New Issue
Block a user