mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-28 10:22:10 +00:00
avrndec: calculate true_height only when used.
Fixes division by 0 Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
7373b3ad04
commit
b119133136
@ -78,12 +78,12 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
|
||||
AVFrame *p = &a->frame;
|
||||
const uint8_t *buf = avpkt->data;
|
||||
int buf_size = avpkt->size;
|
||||
int true_height = buf_size / (2*avctx->width);
|
||||
int y, ret;
|
||||
int y, ret, true_height;
|
||||
|
||||
if(a->is_mjpeg)
|
||||
return ff_mjpeg_decode_frame(avctx, data, data_size, avpkt);
|
||||
|
||||
true_height = buf_size / (2*avctx->width);
|
||||
if(p->data[0])
|
||||
avctx->release_buffer(avctx, p);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user