]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/hevc.c
avcodec/mpeg4videodec: use av_fast_padded_malloc() for bitstream buffer
[ffmpeg] / libavcodec / hevc.c
index 55328b35e42deb0aaca383b89c376b4308de7808..f001a6c627e1bcf2047bddf25397fd9354f88144 100644 (file)
@@ -688,8 +688,8 @@ static int hls_slice_header(HEVCContext *s)
     s->HEVClc->first_qp_group = !s->sh.dependent_slice_segment_flag;
 
     if (!s->pps->cu_qp_delta_enabled_flag)
-        s->HEVClc->qp_y = ((s->sh.slice_qp + 52 + 2 * s->sps->qp_bd_offset) %
-                          (52 + s->sps->qp_bd_offset)) - s->sps->qp_bd_offset;
+        s->HEVClc->qp_y = FFUMOD(s->sh.slice_qp + 52 + 2 * s->sps->qp_bd_offset,
+                                 52 + s->sps->qp_bd_offset) - s->sps->qp_bd_offset;
 
     s->slice_initialized = 1;
 
@@ -2728,6 +2728,8 @@ static av_cold int hevc_decode_free(AVCodecContext *avctx)
             av_freep(&s->sList[i]);
         }
     }
+    if (s->HEVClc == s->HEVClcList[0])
+        s->HEVClc = NULL;
     av_freep(&s->HEVClcList[0]);
 
     for (i = 0; i < s->nals_allocated; i++)