Commit f1e17eb4 authored by Paul B Mahol's avatar Paul B Mahol

avcodec/qtrleenc: fix undefined behaviour

Fixes #7991.
parent 4a51075f
...@@ -259,9 +259,10 @@ static void qtrle_encode_line(QtrleEncContext *s, const AVFrame *p, int line, ui ...@@ -259,9 +259,10 @@ static void qtrle_encode_line(QtrleEncContext *s, const AVFrame *p, int line, ui
/* These bulk costs increase every iteration */ /* These bulk costs increase every iteration */
lowest_bulk_cost += s->pixel_size; lowest_bulk_cost += s->pixel_size;
sec_lowest_bulk_cost += s->pixel_size; sec_lowest_bulk_cost += s->pixel_size;
if (this_line >= p->data[0] + s->pixel_size)
this_line -= s->pixel_size; this_line -= s->pixel_size;
prev_line -= s->pixel_size; if (prev_line >= s->previous_frame->data[0] + s->pixel_size)
prev_line -= s->pixel_size;
} }
/* Good! Now we have the best sequence for this line, let's output it. */ /* Good! Now we have the best sequence for this line, let's output it. */
......
Markdown is supported
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