History

avcodec/prores_raw: Fix heap buffer overflow

When dimensions differ from context, those were updated using ff_set_dimensions, however this overwrote the aligned coded_width and coded_height that were set before, leading to a buffer overflow when writing the frame data. Fixes: OssFuzz 438771336 Fixes: Heap-buffer-overflow

Oliver Chang committed 1 year ago

Commit a2e44591 parent 34c39361 file · +3 −3Browse files

Unified · Split

libavcodec/prores_raw.c+3−3
@@ -367,9 +367,6 @@ static int decode_frame(AVCodecContext *avctx, · 366 unmodified lines
367367 if ((w & 1) || (h & 1))
368368 return AVERROR_INVALIDDATA;
369369
370− avctx->coded_width = FFALIGN(w, 16);
371− avctx->coded_height = FFALIGN(h, 16);
372−
373370 if (w != avctx->width || h != avctx->height) {
374371 av_log(avctx, AV_LOG_WARNING, "picture resolution change: %ix%i -> %ix%i\n",
375372 avctx->width, avctx->height, w, h);
@@ -377,6 +374,9 @@ static int decode_frame(AVCodecContext *avctx, · 1 unmodified line
377374 return ret;
378375 }
379376
377+ avctx->coded_width = FFALIGN(w, 16);
378+ avctx->coded_height = FFALIGN(h, 16);
379+
380380 enum AVPixelFormat pix_fmt = AV_PIX_FMT_BAYER_RGGB16;
381381 if (pix_fmt != s->pix_fmt) {
382382 s->pix_fmt = pix_fmt;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t