summaryrefslogtreecommitdiff
path: root/libavcodec/magicyuvenc.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-10-08 21:14:28 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-10-09 01:17:02 +0200
commit32f0a000fdec70f55cdb702eface1ded8f658a00 (patch)
tree4718204edab8cc304e128faad07dfae8c35e82a5 /libavcodec/magicyuvenc.c
parent17b003a9e29257a48b6b1bbf0e67a0416fcedbb3 (diff)
avcodec/magicyuvenc: Use more correct cast in compare function
There is no need to cast const away (even if it was harmless) and to copy the object at all. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavcodec/magicyuvenc.c')
-rw-r--r--libavcodec/magicyuvenc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/magicyuvenc.c b/libavcodec/magicyuvenc.c
index 9b79ac69b6..d53fe6f328 100644
--- a/libavcodec/magicyuvenc.c
+++ b/libavcodec/magicyuvenc.c
@@ -280,9 +280,9 @@ typedef struct PackageMergerList {
static int compare_by_prob(const void *a, const void *b)
{
- PTable a_val = *(PTable *)a;
- PTable b_val = *(PTable *)b;
- return a_val.prob - b_val.prob;
+ const PTable *a2 = a;
+ const PTable *b2 = b;
+ return a2->prob - b2->prob;
}
static void magy_huffman_compute_bits(PTable *prob_table, HuffEntry *distincts,