[FFmpeg-devel] [PATCH v1 10/10] return value check for init_get_bits in utvideodec.c

maryam ebrahimzadeh me22bee at outlook.com
Thu Aug 12 07:59:17 EEST 2021


---
 libavcodec/utvideodec.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/libavcodec/utvideodec.c b/libavcodec/utvideodec.c
index b39d8a7948..144992ff0d 100644
--- a/libavcodec/utvideodec.c
+++ b/libavcodec/utvideodec.c
@@ -153,7 +153,9 @@ static int decode_plane10(UtvideoContext *c, int plane_no,
         c->bdsp.bswap_buf((uint32_t *) c->slice_bits,
                           (uint32_t *)(src + slice_data_start + c->slices * 4),
                           (slice_data_end - slice_data_start + 3) >> 2);
-        init_get_bits(&gb, c->slice_bits, slice_size * 8);
+        ret = init_get_bits8(&gb, c->slice_bits, slice_size);
+        if (ret < 0)
+            return ret;
 
         prev = 0x200;
         for (j = sstart; j < send; j++) {
@@ -314,7 +316,9 @@ static int decode_plane(UtvideoContext *c, int plane_no,
         c->bdsp.bswap_buf((uint32_t *) c->slice_bits,
                           (uint32_t *)(src + slice_data_start + c->slices * 4),
                           (slice_data_end - slice_data_start + 3) >> 2);
-        init_get_bits(&gb, c->slice_bits, slice_size * 8);
+        ret = init_get_bits8(&gb, c->slice_bits, slice_size);
+        if (ret < 0)
+            return ret;
 
         prev = 0x80;
         for (j = sstart; j < send; j++) {
-- 
2.17.1



More information about the ffmpeg-devel mailing list