Commit 7d1b17b8 authored by Justin Ruggles's avatar Justin Ruggles

cin audio: use sign_extend() instead of casting to int16_t

parent 405af431
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include "avcodec.h" #include "avcodec.h"
#include "bytestream.h" #include "bytestream.h"
#include "mathops.h"
typedef enum CinVideoBitmapIndex { typedef enum CinVideoBitmapIndex {
...@@ -339,7 +340,7 @@ static int cinaudio_decode_frame(AVCodecContext *avctx, ...@@ -339,7 +340,7 @@ static int cinaudio_decode_frame(AVCodecContext *avctx,
delta = cin->delta; delta = cin->delta;
if (cin->initial_decode_frame) { if (cin->initial_decode_frame) {
cin->initial_decode_frame = 0; cin->initial_decode_frame = 0;
delta = (int16_t)AV_RL16(buf); delta = sign_extend(AV_RL16(buf), 16);
buf += 2; buf += 2;
*samples++ = delta; *samples++ = delta;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment