mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-05-07 00:50:27 +00:00
ljpegenc: allocate needed scratch-buffer
Fixes null pointer dereference Fixes Ticket2207 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
a8343bfb6a
commit
c2dd5a18b2
1 changed files with 7 additions and 0 deletions
|
|
@ -57,6 +57,13 @@ static int encode_picture_lossless(AVCodecContext *avctx, AVPacket *pkt,
|
|||
max_pkt_size += mb_width * mb_height * 3 * 4
|
||||
* s->mjpeg_hsample[0] * s->mjpeg_vsample[0];
|
||||
}
|
||||
|
||||
if (!s->edge_emu_buffer &&
|
||||
(ret = ff_mpv_frame_size_alloc(s, pict->linesize[0])) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "failed to allocate context scratch buffers.\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
if ((ret = ff_alloc_packet2(avctx, pkt, max_pkt_size)) < 0)
|
||||
return ret;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue