Justin Ruggles <[email protected]> writes:

> ---
>  libavcodec/wmaprodec.c |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c
> index ce83bb6..03ec15f 100644
> --- a/libavcodec/wmaprodec.c
> +++ b/libavcodec/wmaprodec.c
> @@ -86,6 +86,7 @@
>   * subframe in order to reconstruct the output samples.
>   */
>  
> +#include "libavutil/intreadwrite.h"
>  #include "avcodec.h"
>  #include "internal.h"
>  #include "get_bits.h"
> @@ -819,8 +820,8 @@ static int decode_coeffs(WMAProDecodeCtx *s, int c)
>                      v1 = get_vlc2(&s->gb, vec1_vlc.table, VLCBITS, 
> VEC1MAXDEPTH);
>                      if (v1 == HUFF_VEC1_SIZE - 1)
>                          v1 += ff_wma_get_large_val(&s->gb);
> -                    ((float*)vals)[i  ] = v0;
> -                    ((float*)vals)[i+1] = v1;
> +                    vals[i  ] = ((av_alias32){ .f32 = v0 }).u32;
> +                    vals[i+1] = ((av_alias32){ .f32 = v1 }).u32;
>                  } else {
>                      vals[i]   = fval_tab[symbol_to_vec2[idx] >> 4 ];
>                      vals[i+1] = fval_tab[symbol_to_vec2[idx] & 0xF];
> -- 

OK

Can these values be negative?  If so, there's an undefined unsigned to
signed conversion there which should be addressed as well.  Changing all
the ints holding floats to unsigned is probably a good idea.

-- 
Måns Rullgård
[email protected]
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to