[FFmpeg-devel,1/2] avcodec/gdv: Replace assert() checking bitstream by if()

Submitted by Michael Niedermayer on Aug. 28, 2019, 9:17 p.m.

Details

Message ID 20190828211720.19338-1-michael@niedermayer.cc
State Accepted
Commit a9fae76370baf11a03b2c0ea590bb2d2f3f372ce
Headers show

Commit Message

Michael Niedermayer Aug. 28, 2019, 9:17 p.m.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavcodec/gdv.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Michael Niedermayer Sept. 15, 2019, 10:20 p.m.
On Wed, Aug 28, 2019 at 11:17:19PM +0200, Michael Niedermayer wrote:
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavcodec/gdv.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

will apply

[...]

Patch hide | download patch | download mbox

diff --git a/libavcodec/gdv.c b/libavcodec/gdv.c
index a5ce6b799e..f00f3ac145 100644
--- a/libavcodec/gdv.c
+++ b/libavcodec/gdv.c
@@ -358,7 +358,8 @@  static int decompress_68(AVCodecContext *avctx, unsigned skip, unsigned use8)
                     if (val != ((1 << lbits) - 1)) {
                         break;
                     }
-                    assert(lbits < 16);
+                    if (lbits >= 16)
+                        return AVERROR_INVALIDDATA;
                 }
                 for (i = 0; i < len; i++) {
                     bytestream2_put_byte(pb, bytestream2_get_byte(gb));