[FFmpeg-cvslog] avcodec/g2meet: Check for ff_els_decode_bit() failure in epic_decode_run_length()

Michael Niedermayer git at videolan.org
Fri Jan 15 16:23:53 CET 2016


ffmpeg | branch: release/2.8 | Michael Niedermayer <michael at niedermayer.cc> | Sun Jan 10 16:59:42 2016 +0100| [9cad20822370222dee2a73210b287c56d8f0f125] | committer: Michael Niedermayer

avcodec/g2meet: Check for ff_els_decode_bit() failure in epic_decode_run_length()

Fixes invalid shift
Fixes: g2m_left_shift_2.wmv

Found-by: Piotr Bandurski <ami_stuff at o2.pl>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 030c7f0309ec0e3cadb990408b4bb9b7fd739425)

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9cad20822370222dee2a73210b287c56d8f0f125
---

 libavcodec/g2meet.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/libavcodec/g2meet.c b/libavcodec/g2meet.c
index ba83c67..7d05222 100644
--- a/libavcodec/g2meet.c
+++ b/libavcodec/g2meet.c
@@ -631,6 +631,8 @@ static int epic_decode_run_length(ePICContext *dc, int x, int y, int tile_width,
               (NN  != N)  << 1 |
               (NNW != NW);
         WWneW = ff_els_decode_bit(&dc->els_ctx, &dc->W_ctx_rung[idx]);
+        if (WWneW < 0)
+            return WWneW;
     }
 
     if (WWneW)
@@ -837,10 +839,13 @@ static int epic_decode_tile(ePICContext *dc, uint8_t *out, int tile_height,
                 if (y < 2 || x < 2 || x == tile_width - 1) {
                     run       = 1;
                     got_pixel = epic_handle_edges(dc, x, y, curr_row, above_row, &pix);
-                } else
+                } else {
                     got_pixel = epic_decode_run_length(dc, x, y, tile_width,
                                                        curr_row, above_row,
                                                        above2_row, &pix, &run);
+                    if (got_pixel < 0)
+                        return got_pixel;
+                }
 
                 if (!got_pixel && !epic_predict_from_NW_NE(dc, x, y, run,
                                                            tile_width, curr_row,



More information about the ffmpeg-cvslog mailing list