[FFmpeg-cvslog] avcodec/libx264: move sei_data_size out of the for loop

James Almer git at videolan.org
Wed Oct 20 06:24:52 EEST 2021


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Wed Oct 20 00:21:44 2021 -0300| [1e22ad2adab194ff65fe20fdda1d451ef30cbaab] | committer: James Almer

avcodec/libx264: move sei_data_size out of the for loop

Otherwise its value will be reset on each iteration.

Signed-off-by: James Almer <jamrial at gmail.com>

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

 libavcodec/libx264.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index 13cdd6a022..21f434d06d 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -319,6 +319,7 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame,
 
     if (frame) {
         x264_sei_t *sei = &x4->pic.extra_sei;
+        unsigned int sei_data_size = 0;
 
         for (i = 0; i < x4->pic.img.i_plane; i++) {
             x4->pic.img.plane[i]    = frame->data[i];
@@ -445,7 +446,6 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame,
 
         for (int j = 0; j < frame->nb_side_data; j++) {
             AVFrameSideData *side_data = frame->side_data[j];
-            unsigned int sei_data_size = 0;
             void *tmp;
             x264_sei_payload_t *sei_payload;
             if (side_data->type != AV_FRAME_DATA_SEI_UNREGISTERED)



More information about the ffmpeg-cvslog mailing list