Commit f43da18f authored by Eloi Bail's avatar Eloi Bail Committed by Guillaume Roguez
Browse files

media/video: bad writting access in video scaling

Padding needs sometimes to be done for scaling purpose when a change of video
source is performed. Padding calcul is wrong and leads to memory bad writting

Tuleap: #87
Change-Id: Ied282941077c1e268529457d39cdcc403a741aaf
parent 8c56fd79
......@@ -119,7 +119,7 @@ VideoScaler::scale_and_pad(const VideoFrame& input, VideoFrame& output,
const auto out_desc = av_pix_fmt_desc_get((AVPixelFormat)output_frame->format);
memset(tmp_data_, 0, sizeof(tmp_data_));
for (int i = 0; i < 4 && output_frame->linesize[i]; i++) {
unsigned x_shift=xoff, y_shift=yoff;
signed x_shift=xoff, y_shift=yoff;
if (i == 1 || i == 2) {
x_shift = -((-x_shift) >> out_desc->log2_chroma_w);
y_shift = -((-y_shift) >> out_desc->log2_chroma_h);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment