Skip to content
Snippets Groups Projects
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
access.

Tuleap: #87
Change-Id: Ied282941077c1e268529457d39cdcc403a741aaf
parent 8c56fd79
No related branches found
No related tags found
No related merge requests found
...@@ -119,7 +119,7 @@ VideoScaler::scale_and_pad(const VideoFrame& input, VideoFrame& output, ...@@ -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); const auto out_desc = av_pix_fmt_desc_get((AVPixelFormat)output_frame->format);
memset(tmp_data_, 0, sizeof(tmp_data_)); memset(tmp_data_, 0, sizeof(tmp_data_));
for (int i = 0; i < 4 && output_frame->linesize[i]; i++) { 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) { if (i == 1 || i == 2) {
x_shift = -((-x_shift) >> out_desc->log2_chroma_w); x_shift = -((-x_shift) >> out_desc->log2_chroma_w);
y_shift = -((-y_shift) >> out_desc->log2_chroma_h); y_shift = -((-y_shift) >> out_desc->log2_chroma_h);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment