diff mbox series

[FFmpeg-devel,10/10] Revert "mpeg4videodec: raise an error if sprite_trajectory.table is NULL"

Message ID 20210123204800.689497-10-andreas.rheinhardt@gmail.com
State Accepted
Commit ba96f2254adb23802752ca41f2bd926ffbf15880
Headers show
Series [FFmpeg-devel,01/10] avcodec/atrac3plus_data: Remove unused arrays | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Andreas Rheinhardt Jan. 23, 2021, 8:48 p.m. UTC
This reverts commit 6ac0e7818399a57e4684202bac79f35b3561ad1e.

The mpeg4video parser can reach code that presumes that a certain VLC
has been initialized; yet Libav did not ensure this and Libav bug #1012
[1] is about an ensuing crash.

Instead of fixing the root cause a simple check for whether said VLC
has already been initialized was added; said check is inherently racy.

The proper fix is of course to ensure that the VLC is initialized and
commit 7c76eaeca2791261d3f4f5c98c95f44abdbd879a already ensured this,
so there was no need to merge 6ac0e7818399a57e4684202bac79f35b3561ad1e
at all. This commit therefore reverts said commit.

[1]: https://bugzilla.libav.org/show_bug.cgi?id=1012

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavcodec/mpeg4videodec.c | 4 ----
 1 file changed, 4 deletions(-)

Comments

Andreas Rheinhardt Jan. 26, 2021, 1:27 p.m. UTC | #1
Andreas Rheinhardt:
> This reverts commit 6ac0e7818399a57e4684202bac79f35b3561ad1e.
> 
> The mpeg4video parser can reach code that presumes that a certain VLC
> has been initialized; yet Libav did not ensure this and Libav bug #1012
> [1] is about an ensuing crash.
> 
> Instead of fixing the root cause a simple check for whether said VLC
> has already been initialized was added; said check is inherently racy.
> 
> The proper fix is of course to ensure that the VLC is initialized and
> commit 7c76eaeca2791261d3f4f5c98c95f44abdbd879a already ensured this,
> so there was no need to merge 6ac0e7818399a57e4684202bac79f35b3561ad1e
> at all. This commit therefore reverts said commit.
> 
> [1]: https://bugzilla.libav.org/show_bug.cgi?id=1012
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
> ---
>  libavcodec/mpeg4videodec.c | 4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c
> index a4479f889b..5bfac4ea5a 100644
> --- a/libavcodec/mpeg4videodec.c
> +++ b/libavcodec/mpeg4videodec.c
> @@ -197,10 +197,6 @@ static int mpeg4_decode_sprite_trajectory(Mpeg4DecContext *ctx, GetBitContext *g
>      if (w <= 0 || h <= 0)
>          return AVERROR_INVALIDDATA;
>  
> -    /* the decoder was not properly initialized and we cannot continue */
> -    if (sprite_trajectory.table == NULL)
> -        return AVERROR_INVALIDDATA;
> -
>      for (i = 0; i < ctx->num_sprite_warping_points; i++) {
>          int length;
>          int x = 0, y = 0;
> 
Will apply this tomorrow unless there are objections.

- Andreas
diff mbox series

Patch

diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c
index a4479f889b..5bfac4ea5a 100644
--- a/libavcodec/mpeg4videodec.c
+++ b/libavcodec/mpeg4videodec.c
@@ -197,10 +197,6 @@  static int mpeg4_decode_sprite_trajectory(Mpeg4DecContext *ctx, GetBitContext *g
     if (w <= 0 || h <= 0)
         return AVERROR_INVALIDDATA;
 
-    /* the decoder was not properly initialized and we cannot continue */
-    if (sprite_trajectory.table == NULL)
-        return AVERROR_INVALIDDATA;
-
     for (i = 0; i < ctx->num_sprite_warping_points; i++) {
         int length;
         int x = 0, y = 0;