mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-08-07 13:55:56 +01:00
Verify multiple APNG lengths to prevent bad input from crashing.
This commit is contained in:
Vendored
+1
-1
@@ -25,7 +25,7 @@ class ApngInputStreamFactoryResourceDecoder : ResourceDecoder<InputStreamFactory
|
||||
|
||||
@Throws(IOException::class)
|
||||
override fun decode(source: InputStreamFactory, width: Int, height: Int, options: Options): Resource<ApngDecoder>? {
|
||||
val decoder = ApngDecoder.create { source.create() }
|
||||
val decoder = ApngDecoder.create(contentLength = source.length()) { source.create() }
|
||||
return ApngResource(decoder)
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@ internal class EncryptedApngCacheDecoder(private val secret: ByteArray) : Encryp
|
||||
|
||||
@Throws(IOException::class)
|
||||
override fun decode(source: File, width: Int, height: Int, options: Options): Resource<ApngDecoder>? {
|
||||
val decoder = ApngDecoder.create { createEncryptedInputStream(secret, source) }
|
||||
val decoder = ApngDecoder.create(contentLength = source.length()) { createEncryptedInputStream(secret, source) }
|
||||
return ApngResource(decoder)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user