diff mbox series

[FFmpeg-devel] Fix incorrect enum type used for a local variable

Message ID 20241025015245.35832-1-ezemtsov@google.com
State New
Headers show
Series [FFmpeg-devel] Fix incorrect enum type used for a local variable | expand

Checks

Context Check Description
yinshiyou/commit_msg_loongarch64 warning The first line of the commit message must start with a context terminated by a colon and a space, for example "lavu/opt: " or "doc: ".
andriy/commit_msg_x86 warning The first line of the commit message must start with a context terminated by a colon and a space, for example "lavu/opt: " or "doc: ".
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Eugene Zemtsov Oct. 25, 2024, 1:52 a.m. UTC
From: Eugene Zemtsov <eugene@chromium.org>

It's AVPacketSideDataType, not AVFrameSideDataType.

Bug: https://issues.chromium.org/issues/374797732
Change-Id: If75702c6d639ca63827cc3370477de00544d3c0f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/third_party/ffmpeg/+/5950926
Reviewed-by: Ted (Chromium) Meyer <tmathmeyer@chromium.org>
---
 libavcodec/decode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Eugene Zemtsov Nov. 5, 2024, 9:09 p.m. UTC | #1
Any feedback?

On Thu, Oct 24, 2024 at 6:52 PM <ezemtsov@google.com> wrote:

> From: Eugene Zemtsov <eugene@chromium.org>
>
> It's AVPacketSideDataType, not AVFrameSideDataType.
>
> Bug: https://issues.chromium.org/issues/374797732
> Change-Id: If75702c6d639ca63827cc3370477de00544d3c0f
> Reviewed-on:
> https://chromium-review.googlesource.com/c/chromium/third_party/ffmpeg/+/5950926
> Reviewed-by
> <https://chromium-review.googlesource.com/c/chromium/third_party/ffmpeg/+/5950926Reviewed-by>:
> Ted (Chromium) Meyer <tmathmeyer@chromium.org>
> ---
>  libavcodec/decode.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavcodec/decode.c b/libavcodec/decode.c
> index c331bb8596..fbb6be2971 100644
> --- a/libavcodec/decode.c
> +++ b/libavcodec/decode.c
> @@ -1466,7 +1466,7 @@ static int side_data_map(AVFrame *dst,
>
>  {
>      for (int i = 0; map[i].packet < AV_PKT_DATA_NB; i++) {
> -        const enum AVFrameSideDataType type_pkt   = map[i].packet;
> +        const enum AVPacketSideDataType type_pkt   = map[i].packet;
>          const enum AVFrameSideDataType type_frame = map[i].frame;
>          const AVPacketSideData *sd_pkt;
>          AVFrameSideData *sd_frame;
> --
> 2.47.0.163.g1226f6d8fa-goog
>
>
Marth64 Nov. 8, 2024, 6:11 p.m. UTC | #2
Eugene Zemtsov:

LGTM. Is there a way to reproduce any bug that this fixes?

Will test for side effects and wait for a few days in case anyone has
comments or concerns.

Thank you
Eugene Zemtsov Nov. 8, 2024, 10 p.m. UTC | #3
In order to reproduce the problem you need to compile with warnings as
errors and "enum-conversion" warning enabled.
This is the what clang complains about:

../../third_party/ffmpeg/libavcodec/decode.c:1469:60: error: implicit
conversion from enumeration type 'const enum AVPacketSideDataType' to
different enumeration type 'enum AVFrameSideDataType'
[-Werror,-Wenum-conversion]
 1469 |         const enum AVFrameSideDataType type_pkt   = map[i].packet;
      |                                        ~~~~~~~~     ~~~~~~~^~~~~~
../../third_party/ffmpeg/libavcodec/decode.c:1474:58: error: implicit
conversion from enumeration type 'const enum AVFrameSideDataType' to
different enumeration type 'enum AVPacketSideDataType'
[-Werror,-Wenum-conversion]
 1474 |         sd_pkt = packet_side_data_get(sd_src, nb_sd_src, type_pkt);
      |                  ~~~~~~~~~~~~~~~~~~~~                    ^~~~~~~~


On Fri, Nov 8, 2024 at 10:11 AM Marth64 <marth64@proxyid.net> wrote:

> Eugene Zemtsov:
>
> LGTM. Is there a way to reproduce any bug that this fixes?
>
> Will test for side effects and wait for a few days in case anyone has
> comments or concerns.
>
> Thank you
>
Marth64 Nov. 8, 2024, 10:26 p.m. UTC | #4
Thank you very much
diff mbox series

Patch

diff --git a/libavcodec/decode.c b/libavcodec/decode.c
index c331bb8596..fbb6be2971 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -1466,7 +1466,7 @@  static int side_data_map(AVFrame *dst,
 
 {
     for (int i = 0; map[i].packet < AV_PKT_DATA_NB; i++) {
-        const enum AVFrameSideDataType type_pkt   = map[i].packet;
+        const enum AVPacketSideDataType type_pkt   = map[i].packet;
         const enum AVFrameSideDataType type_frame = map[i].frame;
         const AVPacketSideData *sd_pkt;
         AVFrameSideData *sd_frame;