Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/libavcodec/vorbis.c b/libavcodec/vorbis.c
- index 28176f3..995d468 100644
- --- a/libavcodec/vorbis.c
- +++ b/libavcodec/vorbis.c
- @@ -179,12 +179,14 @@ static inline void render_line_unrolled(intptr_t x, uint8_t y, int x1,
- }
- }
- -static void render_line(int x0, uint8_t y0, int x1, int y1, float *buf)
- +static int render_line(int x0, uint8_t y0, int x1, int y1, float *buf)
- {
- int dy = y1 - y0;
- int adx = x1 - x0;
- int ady = FFABS(dy);
- int sy = dy < 0 ? -1 : 1;
- + if (adx == 0)
- + return -1;
- buf[x0] = ff_vorbis_floor1_inverse_db_table[y0];
- if (ady*2 <= adx) { // optimized common case
- render_line_unrolled(x0, y0, x1, sy, ady, adx, buf);
- @@ -204,6 +206,7 @@ static void render_line(int x0, uint8_t y0, int x1, int y1, float *buf)
- buf[x] = ff_vorbis_floor1_inverse_db_table[y];
- }
- }
- + return 0;
- }
- void ff_vorbis_floor1_render_list(vorbis_floor1_entry * list, int values,
- @@ -220,7 +223,8 @@ void ff_vorbis_floor1_render_list(vorbis_floor1_entry * list, int values,
- int x1 = list[pos].x;
- int y1 = y_list[pos] * multiplier;
- if (lx < samples)
- - render_line(lx, ly, FFMIN(x1,samples), y1, out);
- + if (render_line(lx, ly, FFMIN(x1,samples), y1, out) == -1)
- + return ;
- lx = x1;
- ly = y1;
- }
- @@ -228,5 +232,6 @@ void ff_vorbis_floor1_render_list(vorbis_floor1_entry * list, int values,
- break;
- }
- if (lx < samples)
- - render_line(lx, ly, samples, ly, out);
- + if (render_line(lx, ly, samples, ly, out) == -1)
- + return;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement